allocatr/application/worker/controller/OrderDispatch.php
2025-04-01 20:56:11 +08:00

37 lines
938 B
PHP

<?php
namespace app\worker\controller;
use app\common\controller\WorkerApi;
class OrderDispatch extends WorkerApi
{
protected $noNeedLogin = [];
/**
* 待接单列表
* @return void
*/
public function index()
{
$res = $this->getOrderDispatchService()->dispatchList($this->user['id'], $this->request->request('page_size', 20));
$this->success('获取成功', $res);
}
/**
* 接单/拒接
* @return void
*/
public function orderConfirm()
{
$params = $this->request->request();
$validate = $this->validate($params, \app\worker\validate\OrderDispatch::class . '.orderConfirm');
if ($validate !== true) {
$this->error($validate);
}
$res = $this->getOrderDispatchService()->orderConfirm($this->user['id'], $params['order_dispatch_id'], $params['type']);
$this->success('操作成功', $res);
}
}