Kaynağa Gözat

首页通知

whitefang 1 yıl önce
ebeveyn
işleme
bee37f74e5

+ 15 - 5
app/workerapi/controller/MasterWorkerMessageController.php

@@ -2,6 +2,7 @@
 
 namespace app\workerapi\controller;
 
+use app\adminapi\logic\works\ServiceWorkLogic;
 use app\workerapi\lists\MasterWorkerMessageLists;
 use app\workerapi\logic\MasterWorkerMessageLogic;
 
@@ -49,12 +50,21 @@ class MasterWorkerMessageController extends BaseApiController
      */
     public function orderPrompt()
     {
-        $result = MasterWorkerMessageLogic::orderPrompt($this->userId);
-        if ($result) {
-            $result = ['confirm_code'=>101,'msg'=>'您有新的工单未领取,请点击领取'];
-        }else{
-            $result = ['confirm_code'=>0,'msg'=>'无'];
+        $result = ['confirm_code'=>0,'msg'=>'无'];
+        $prompt_result = MasterWorkerMessageLogic::orderPrompt($this->userId);
+        //新工单领取
+        if(!empty($prompt_result)){
+            $result = ['confirm_code'=>100,'msg'=>'您有新的工单未领取,请点击领取','data'=>[]];
+            return $this->success('操作成功', $result, 1, 0);
         }
+
+        //预约时间更新确认
+        $appoint_result = ServiceWorkLogic::getAppointmentNotice($this->userId);
+        if(!empty($appoint_result)){
+            $result = ['confirm_code'=>102,'msg'=>'您有工单更改了预约时间,请注意查看','data'=>$appoint_result];
+            return $this->success('操作成功', $result, 1, 0);
+        }
+
         return $this->success('操作成功', $result, 1, 0);
     }
 

+ 0 - 10
app/workerapi/controller/WorksController.php

@@ -250,16 +250,6 @@ class WorksController extends BaseApiController
         return $this->dataLists(new GoodsFeeStandardsLists());
     }
 
-    /**
-     * 预约通知提醒
-     * @return \think\response\Json
-     */
-    public function appointmentNotice()
-    {
-        $result = ServiceWorkLogic::getAppointmentNotice($this->userId);
-        return $this->data($result);
-    }
-
     /**
      * 预约通知确认
      * @return \think\response\Json