params['service_status'] ?? 3; $service_status = $service_status == 4 ? '4,5':$service_status; $where[] = ['master_worker_id','=',$this->userId]; $where[] = ['approval','=',1]; $where[] = ['service_status','in',$service_status]; //查询月数 $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','work_total','create_time','work_amount']) ->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)->whereMonth('create_time', $create_month)->count(); return $list; } /** * @notes 获取数量 * @return int * @author whitef * @date 2024/07/10 15:06 */ public function count(): int { return $this->count; } }