Ver código fonte

入驻/下单的弹框在特定页面弹出

liugc 1 ano atrás
pai
commit
2ae4236f92

+ 2 - 1
app/adminapi/controller/notice/NoticeController.php

@@ -73,7 +73,8 @@ class NoticeController extends BaseAdminController
      */
     public function getInformation()
     {
-        $result = NoticeLogic::getInformation($this->adminId);
+        $params = $this->request->post();
+        $result = NoticeLogic::getInformation($params);
         if ($result) {
             return $this->success('获取成功', $result);
         }

+ 23 - 18
app/adminapi/logic/notice/NoticeLogic.php

@@ -225,7 +225,7 @@ class NoticeLogic extends BaseLogic
         }
     }
 
-    public static function getInformation($adminId)
+    public static function getInformation($params)
     {
         try {
             $noticeInfo = [
@@ -233,24 +233,29 @@ class NoticeLogic extends BaseLogic
                 'massage' => '',
                 'to_router' => '',
             ];
-            if(!in_array($adminId,[1,2])){
-                return $noticeInfo;
-            }
-            // 用户下单待派单
-            $serviceWorkCount = ServiceWork::where('work_status', 0)->where('work_pay_status','>', 0)->count('id');
-            if($serviceWorkCount){
-                $noticeInfo['confirm_code'] = 101;
-                $noticeInfo['massage'] .= '您有'.$serviceWorkCount.'个工单待派单';
-                $noticeInfo['to_router'] = '/works/service_work';
-                return $noticeInfo;
-            }
-            // 师傅入驻待审核
-            $workerRegisterCount = MasterWorkerRegister::where('status', 0)->count('id');
-            if($workerRegisterCount){
-                $noticeInfo['confirm_code'] = 101;
-                $noticeInfo['massage'] .= '您有'.$workerRegisterCount.'个师傅入驻待审核';
-                $noticeInfo['to_router'] = '/worker/master_worker_register';
+            /*if(!in_array($adminId,[1,2])){
                 return $noticeInfo;
+            }*/
+            //$params['business_code']
+            switch ($params['business_code']){
+                case 'service_work':
+                    // 用户下单待派单
+                    $serviceWorkCount = ServiceWork::where('work_status', 0)->where('work_pay_status','>', 0)->count('id');
+                    if($serviceWorkCount){
+                        $noticeInfo['confirm_code'] = 101;
+                        $noticeInfo['massage'] .= '您有'.$serviceWorkCount.'个工单待派单';
+                        $noticeInfo['to_router'] = '/works/service_work';
+                    }
+                    break;
+                case 'worker_register':
+                    // 师傅入驻待审核
+                    $workerRegisterCount = MasterWorkerRegister::where('status', 0)->count('id');
+                    if($workerRegisterCount){
+                        $noticeInfo['confirm_code'] = 101;
+                        $noticeInfo['massage'] .= '您有'.$workerRegisterCount.'个师傅入驻待审核';
+                        $noticeInfo['to_router'] = '/worker/master_worker_register?master_worker_register.master_worker_register/lists';
+                    }
+                    break;
             }
             return $noticeInfo;
         } catch (\Exception $e) {