优化:平台抽成记录表添加订单信息
This commit is contained in:
parent
5e7400560c
commit
9eabc934a9
|
|
@ -5,6 +5,7 @@
|
||||||
namespace app\common\model\store\platformCommission;
|
namespace app\common\model\store\platformCommission;
|
||||||
|
|
||||||
use app\common\model\BaseModel;
|
use app\common\model\BaseModel;
|
||||||
|
use app\common\model\store\order\StoreOrder;
|
||||||
use app\common\model\system\merchant\Merchant;
|
use app\common\model\system\merchant\Merchant;
|
||||||
use app\common\model\user\User;
|
use app\common\model\user\User;
|
||||||
use think\model\concern\SoftDelete;
|
use think\model\concern\SoftDelete;
|
||||||
|
|
@ -43,4 +44,14 @@ class Record extends BaseModel
|
||||||
public function mer(){
|
public function mer(){
|
||||||
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Common: 关联订单表
|
||||||
|
* Author: wu-hui
|
||||||
|
* Time: 2023/12/27 16:02
|
||||||
|
* @return \think\model\relation\HasOne
|
||||||
|
*/
|
||||||
|
public function storeOrder(){
|
||||||
|
return $this->hasOne(StoreOrder::class,'order_id','order_id');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,9 @@ class RecordRepository extends BaseRepository{
|
||||||
},
|
},
|
||||||
'user' => function($query){
|
'user' => function($query){
|
||||||
$query->field('uid,nickname,avatar')->bind(['nickname','avatar']);
|
$query->field('uid,nickname,avatar')->bind(['nickname','avatar']);
|
||||||
|
},
|
||||||
|
'storeOrder' => function($query){
|
||||||
|
$query->field('order_id,order_sn');
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
->order('create_time DESC');
|
->order('create_time DESC');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue