21 lines
463 B
PHP
21 lines
463 B
PHP
<?php
|
|
namespace app\common\model;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Order extends Model
|
|
{
|
|
protected $table = 'orders';
|
|
|
|
protected $guarded = [];
|
|
|
|
// 隐藏时间戳等不必要字段,保持前端接口整洁
|
|
protected $hidden = ['updated_at'];
|
|
|
|
// 关联订单流转日志 (时间轴)
|
|
public function logs()
|
|
{
|
|
return $this->hasMany(OrderLog::class, 'order_id', 'id')->orderBy('created_at', 'desc');
|
|
}
|
|
}
|