Преглед изворни кода

用户改约通知,必须在师傅领单之后再触发

whitefang пре 1 година
родитељ
комит
ea06aed88a

+ 1 - 1
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -626,7 +626,7 @@ class ServiceWorkLogic extends BaseLogic
     public static function getAppointmentNotice($userId)
     {
         return ServiceWork::where(['master_worker_id'=>$userId,'appoint_approval'=>1])
-            ->field(['id', 'work_sn','real_name','mobile', 'address', 'title', 'appointment_time'])
+            ->field(['id', 'work_sn','real_name','mobile', 'address', 'title', 'appointment_time','work_status'])
             ->order(['appointment_time' => 'asc'])//上门时间排序
             ->select()->each(function (&$item){
                 $item['last_appointment_time'] = date('Y-m-d H:i:s',ServiceWorkAppointmentLog::where('work_id',$item['id'])->order('id desc')->value('last_appointment_time'));

+ 1 - 1
app/workerapi/controller/MasterWorkerMessageController.php

@@ -60,7 +60,7 @@ class MasterWorkerMessageController extends BaseApiController
 
         //预约时间更新确认
         $appoint_result = ServiceWorkLogic::getAppointmentNotice($this->userId);
-        if(!empty($appoint_result)){
+        if(!empty($appoint_result) and $appoint_result['work_status']>1 and $appoint_result['work_status']<7){
             $result = ['confirm_code'=>102,'msg'=>'您有工单更改了预约时间,请注意查看','data'=>$appoint_result];
             return $this->success('操作成功', $result, 1, 0);
         }