Explorar el Código

师傅端工单列表

whitefang hace 1 año
padre
commit
6a87d25678
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      app/workerapi/lists/HistoryWorkLists.php

+ 4 - 1
app/workerapi/lists/HistoryWorkLists.php

@@ -30,15 +30,18 @@ class HistoryWorkLists extends BaseWorkerDataLists
             'service_status'=>$this->params['service_status']?3:4,
         ];
 
+        //查询月数
+        $create_month = !empty($this->params['create_month'])?$this->params['create_month']:date('Y-m');
         $list = ServiceWork::where($where)
             ->field(['id', 'work_sn', 'address', 'title', 'work_status', 'service_status','work_pay_status','finished_time','base_service_fee','service_fee','create_time'])
             ->append(['work_status_text','service_status_text'])
+            ->whereMonth('create_time', $create_month)
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->select()
             ->toArray();
 
-        $this->count = ServiceWork::where($where)->count();
+        $this->count = ServiceWork::where($where)->whereMonth('create_time', $create_month)->count();
 
         return $list;
     }