38 lines
705 B
PHP
38 lines
705 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\DealerLvl;
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DealerPurchaseLog extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
|
|
protected $casts = [
|
|
'lvl' => DealerLvl::class,
|
|
'order_completed_at' => 'datetime',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'lvl',
|
|
'order_id',
|
|
'total_amount',
|
|
'path',
|
|
'remark',
|
|
'order_completed_at',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function order()
|
|
{
|
|
return $this->belongsTo(DealerOrder::class, 'order_id');
|
|
}
|
|
}
|