43 lines
712 B
PHP
43 lines
712 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SalesValueLog extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
|
|
public const TYPE_INDIVIDUAL = 1;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $attributes = [
|
|
'type' => self::TYPE_INDIVIDUAL,
|
|
];
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'order_id',
|
|
'order_user_id',
|
|
'type',
|
|
'change_sales_value',
|
|
'remarks',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function order()
|
|
{
|
|
return $this->belongsTo(Order::class);
|
|
}
|
|
}
|