feat: 工单支持修改上门时间

This commit is contained in:
gcd 2025-05-08 20:52:12 +08:00
parent c4adcf28a5
commit 05529db202

View File

@ -267,12 +267,16 @@ class OrderDispatchService extends BaseService
public function updatePlanTime(int $workerId, int $orderDispatchId, string $planTime)
{
$orderDispatch = $this->getOrderDispatchInfo($workerId, $orderDispatchId);
if ($orderDispatch->status !== OrderDispatch::STATUS_PLANIT) {
$this->apiError('该单不支持修改上门时间');
}
$orderDispatch->plan_time = $planTime;
$orderDispatch->save();
$orderDispatchChangeParams = [
'dispatch' => $orderDispatch,
'remark' => `师傅已修改上门时间,旧的时间:${$orderDispatch->plan_time},新的时间:${$planTime}`
'remark' => "师傅修改上门时间,旧的时间:{$orderDispatch->plan_time},新的时间:$planTime"
];
Hook::listen('order_dispatch_change', $orderDispatchChangeParams);