feat: 优化
This commit is contained in:
parent
087315f2cf
commit
c4adcf28a5
|
|
@ -264,6 +264,21 @@ class OrderDispatchService extends BaseService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updatePlanTime(int $workerId, int $orderDispatchId, string $planTime)
|
||||||
|
{
|
||||||
|
$orderDispatch = $this->getOrderDispatchInfo($workerId, $orderDispatchId);
|
||||||
|
$orderDispatch->plan_time = $planTime;
|
||||||
|
$orderDispatch->save();
|
||||||
|
|
||||||
|
$orderDispatchChangeParams = [
|
||||||
|
'dispatch' => $orderDispatch,
|
||||||
|
'remark' => `师傅已修改上门时间,旧的时间:${$orderDispatch->plan_time},新的时间:${$planTime}`
|
||||||
|
];
|
||||||
|
Hook::listen('order_dispatch_change', $orderDispatchChangeParams);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完成上门
|
* 完成上门
|
||||||
* @param int $workerId 师傅id
|
* @param int $workerId 师傅id
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,22 @@ class OrderDispatch extends WorkerApi
|
||||||
$this->success('操作成功', $res);
|
$this->success('操作成功', $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改上门时间
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function updatePlanTime()
|
||||||
|
{
|
||||||
|
$params = $this->request->request();
|
||||||
|
$validate = $this->validate($params, \app\worker\validate\OrderDispatch::class . '.appointmentTime');
|
||||||
|
if ($validate !== true) {
|
||||||
|
$this->error($validate);
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = $this->getOrderDispatchService()->updatePlanTime($this->user['id'], $params['order_dispatch_id'], $params['plan_time']);
|
||||||
|
$this->success('操作成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交上门信息
|
* 提交上门信息
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user