瀏覽代碼

用户新约时间确认,15分钟不确认进行后台提醒,工程师确定后发通知给用户

liugc 1 年之前
父節點
當前提交
f179b0a3db
共有 2 個文件被更改,包括 14 次插入2 次删除
  1. 2 2
      app/adminapi/lists/works/ServiceWorkLists.php
  2. 12 0
      app/adminapi/logic/notice/NoticeLogic.php

+ 2 - 2
app/adminapi/lists/works/ServiceWorkLists.php

@@ -40,7 +40,7 @@ class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterfac
     public function setSearch(): array
     {
         return [
-            '=' => ['id','work_sn', 'real_name', 'mobile', 'address', 'title', 'category_type', 'base_service_fee', 'service_fee', 'work_status','work_pay_status', 'service_status',  'finished_images', 'master_worker_id', 'work_amount','work_type','appoint_approval'],
+            '=' => ['id','work_sn', 'real_name', 'mobile', 'address', 'title', 'category_type', 'base_service_fee', 'service_fee', 'work_status','work_pay_status', 'service_status',  'finished_images', 'master_worker_id', 'work_amount','work_type','appoint_approval','refund_approval'],
 
         ];
     }
@@ -119,7 +119,7 @@ class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterfac
         ])
             ->where($this->searchWhere)
             ->where($this->queryWhere())
-            ->field(['id', 'work_sn', 'real_name', 'mobile', 'address', 'title', 'category_type', 'goods_category_ids', 'goods_category_id', 'base_service_fee', 'service_fee', 'work_status','work_pay_status', 'service_status', 'dispatch_time', 'receive_time', 'appointment_time', 'finished_images', 'finished_time', 'master_worker_id', 'work_amount', 'work_type', 'create_time', 'update_time','lon', 'lat','appoint_approval'])
+            ->field(['id', 'work_sn', 'real_name', 'mobile', 'address', 'title', 'category_type', 'goods_category_ids', 'goods_category_id', 'base_service_fee', 'service_fee', 'work_status','work_pay_status', 'service_status', 'dispatch_time', 'receive_time', 'appointment_time', 'finished_images', 'finished_time', 'master_worker_id', 'work_amount', 'work_type', 'create_time', 'update_time','lon', 'lat','appoint_approval','refund_approval'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->select()

+ 12 - 0
app/adminapi/logic/notice/NoticeLogic.php

@@ -259,6 +259,7 @@ class NoticeLogic extends BaseLogic
                     $serviceWorkCount = ServiceWork::where('work_status', 0)->where('work_pay_status','>', 0)->count('id');
                     if($serviceWorkCount){
                         $noticeInfo['confirm_code'] = 101;
+                        $noticeInfo['count'] = $serviceWorkCount;
                         $noticeInfo['massage'] .= '您有'.$serviceWorkCount.'个工单待派单';
                         $noticeInfo['to_router'] = '/works/service_work';
                     }
@@ -268,10 +269,21 @@ class NoticeLogic extends BaseLogic
                     $workerRegisterCount = MasterWorkerRegister::where('status', 0)->count('id');
                     if($workerRegisterCount){
                         $noticeInfo['confirm_code'] = 101;
+                        $noticeInfo['count'] = $workerRegisterCount;
                         $noticeInfo['massage'] .= '您有'.$workerRegisterCount.'个工程师入驻待审核';
                         $noticeInfo['to_router'] = '/worker/master_worker_register?master_worker_register.master_worker_register/lists';
                     }
                     break;
+                case 'appoint_approval':
+                    // 用户更新工单上门时间超过15分钟工程师未确认
+                    $serviceWorkCount = ServiceWork::where('appoint_approval', 1)->where('work_pay_status','>',0)->where('update_time','<', time()-15*60)->count('id');
+                    if($serviceWorkCount){
+                        $noticeInfo['confirm_code'] = 101;
+                        $noticeInfo['count'] = $serviceWorkCount;
+                        $noticeInfo['massage'] .= '您有'.$serviceWorkCount.'个工单超过15分钟工程师未确认新上门时间';
+                        $noticeInfo['to_router'] = '/works/service_work';
+                    }
+                    break;
             }
             return $noticeInfo;
         } catch (\Exception $e) {