feat: 接单列表接口
This commit is contained in:
parent
a8d2980e23
commit
0f0e5a467d
|
|
@ -14,8 +14,8 @@ class OrderDispatch extends Model
|
|||
|
||||
];
|
||||
|
||||
// public function orderInfo()
|
||||
// {
|
||||
// return $this->belongsTo('User','uid');
|
||||
// }
|
||||
public function orderInfo()
|
||||
{
|
||||
return $this->belongsTo(Order::class,'order_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,14 @@ class OrderDispatchService extends BaseService
|
|||
{
|
||||
public function dispatchList(int $workerId, int $pageSize)
|
||||
{
|
||||
$model = $this->getOrderDispatchModel()
|
||||
return $this->getOrderDispatchModel()
|
||||
->with(['orderInfo' => function ($query) {
|
||||
$query->field('id,order_no,item_id,item_title,receive_type,address,lng,lat,plan_time,online_amount,discount_amount');
|
||||
}])
|
||||
->where('status', OrderDispatch::STATUS_TOGET)
|
||||
->where('worker_id', $workerId)
|
||||
->field(['id', 'order_id', 'status', 'remark', 'plan_time', 'create_time'])
|
||||
->field(['id', 'order_id', 'status', 'remark', 'create_time'])
|
||||
->order('id desc')
|
||||
->paginate($pageSize);
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ use app\common\controller\WorkerApi;
|
|||
|
||||
class Order extends WorkerApi
|
||||
{
|
||||
protected $noNeedLogin = ['*'];
|
||||
protected $noNeedLogin = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class Worker extends WorkerApi
|
|||
|
||||
public function guestLogin()
|
||||
{
|
||||
$this->workerLogin(1);
|
||||
$this->workerLogin(9);
|
||||
$this->success('登录成功', $this->user);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user