feat: 工单支持修改上门时间
This commit is contained in:
parent
c4adcf28a5
commit
05529db202
|
|
@ -267,12 +267,16 @@ class OrderDispatchService extends BaseService
|
||||||
public function updatePlanTime(int $workerId, int $orderDispatchId, string $planTime)
|
public function updatePlanTime(int $workerId, int $orderDispatchId, string $planTime)
|
||||||
{
|
{
|
||||||
$orderDispatch = $this->getOrderDispatchInfo($workerId, $orderDispatchId);
|
$orderDispatch = $this->getOrderDispatchInfo($workerId, $orderDispatchId);
|
||||||
|
if ($orderDispatch->status !== OrderDispatch::STATUS_PLANIT) {
|
||||||
|
$this->apiError('该单不支持修改上门时间');
|
||||||
|
}
|
||||||
|
|
||||||
$orderDispatch->plan_time = $planTime;
|
$orderDispatch->plan_time = $planTime;
|
||||||
$orderDispatch->save();
|
$orderDispatch->save();
|
||||||
|
|
||||||
$orderDispatchChangeParams = [
|
$orderDispatchChangeParams = [
|
||||||
'dispatch' => $orderDispatch,
|
'dispatch' => $orderDispatch,
|
||||||
'remark' => `师傅已修改上门时间,旧的时间:${$orderDispatch->plan_time},新的时间:${$planTime}`
|
'remark' => "师傅修改上门时间,旧的时间:{$orderDispatch->plan_time},新的时间:$planTime"
|
||||||
];
|
];
|
||||||
Hook::listen('order_dispatch_change', $orderDispatchChangeParams);
|
Hook::listen('order_dispatch_change', $orderDispatchChangeParams);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user