first commit
This commit is contained in:
20
app/common/model/Order.php
Normal file
20
app/common/model/Order.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user