belongsTo(\app\admin\model\User::class, 'buyer_id')->field('id,nickname,avatar,mobile,prevtime,logintime,jointime'); } public function agent() { return $this->belongsTo(\app\admin\model\User::class, 'agent_id')->field('id,nickname,avatar,mobile,prevtime,logintime,jointime'); } public function order() { return $this->belongsTo(\app\admin\model\shopro\order\Order::class, 'order_id'); } /** * 待入账 */ public function scopeWaiting($query) { return $query->where('status', 0); } public function commissionOrder() { // 要把 下单人信息移除 return $this->belongsTo(\app\admin\model\shopro\commission\Order::class, 'commission_order_id'); } }