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