瀏覽代碼

投诉工单列表

whitefang 1 年之前
父節點
當前提交
174a8f1bb0
共有 2 個文件被更改,包括 12 次插入3 次删除
  1. 4 2
      app/workerapi/lists/IssueWorkLists.php
  2. 8 1
      app/workerapi/lists/ReturnWorkLists.php

+ 4 - 2
app/workerapi/lists/IssueWorkLists.php

@@ -46,7 +46,10 @@ class IssueWorkLists extends BaseWorkerDataLists implements ListsSearchInterface
      */
      */
     public function lists(): array
     public function lists(): array
     {
     {
-        return IssueWork::where($this->searchWhere)
+        return IssueWork::with(['service_work'=>function ($query) {
+            $query->field(['id', 'work_sn', 'address', 'title', 'work_status', 'service_status', 'work_pay_status','appointment_time','receive_time','base_service_fee','service_fee'])->append(['work_status_text','service_status_text']);
+        }])
+        ->where($this->searchWhere)
             ->where($this->querySearch())
             ->where($this->querySearch())
             ->field(['id', 'work_sn', 'service_work_id', 'issue_approval', 'complaint_status', 'responsible', 'complaint_details', 'complaint_images', 'finished_time', 'create_time', 'update_time'])
             ->field(['id', 'work_sn', 'service_work_id', 'issue_approval', 'complaint_status', 'responsible', 'complaint_details', 'complaint_images', 'finished_time', 'create_time', 'update_time'])
             ->limit($this->limitOffset, $this->limitLength)
             ->limit($this->limitOffset, $this->limitLength)
@@ -55,7 +58,6 @@ class IssueWorkLists extends BaseWorkerDataLists implements ListsSearchInterface
             ->toArray();
             ->toArray();
     }
     }
 
 
-
     /**
     /**
      * @notes 获取数量
      * @notes 获取数量
      * @return int
      * @return int

+ 8 - 1
app/workerapi/lists/ReturnWorkLists.php

@@ -27,6 +27,12 @@ class ReturnWorkLists extends BaseWorkerDataLists implements ListsSearchInterfac
         ];
         ];
     }
     }
 
 
+    public function querySearch(): array
+    {
+        $where['master_worker_id'] = ['=',$this->userId];
+        return $where;
+    }
+
 
 
     /**
     /**
      * @notes 获取列表
      * @notes 获取列表
@@ -40,6 +46,7 @@ class ReturnWorkLists extends BaseWorkerDataLists implements ListsSearchInterfac
     public function lists(): array
     public function lists(): array
     {
     {
         return ReturnWork::where($this->searchWhere)
         return ReturnWork::where($this->searchWhere)
+            ->where($this->querySearch())
             ->field(['id', 'work_sn', 'service_work_id', 'issue_work_id', 'return_work_status', 'dispatch_time', 'appointment_time', 'finished_images', 'finished_time', 'master_worker_id', 'create_time', 'update_time'])
             ->field(['id', 'work_sn', 'service_work_id', 'issue_work_id', 'return_work_status', 'dispatch_time', 'appointment_time', 'finished_images', 'finished_time', 'master_worker_id', 'create_time', 'update_time'])
             ->limit($this->limitOffset, $this->limitLength)
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->order(['id' => 'desc'])
@@ -56,7 +63,7 @@ class ReturnWorkLists extends BaseWorkerDataLists implements ListsSearchInterfac
      */
      */
     public function count(): int
     public function count(): int
     {
     {
-        return ReturnWork::where($this->searchWhere)->count();
+        return ReturnWork::where($this->searchWhere)->where($this->querySearch())->count();
     }
     }
 
 
 }
 }