params['month'])){ $firstDay =date("Y-m-d 00:00:00", strtotime("first day of {$this->params['month']}")); $lastDay = date("Y-m-d 23:59:59", strtotime("{$this->params['month']} +1 month -1 day")); $firstTime = strtotime($firstDay); $lastTime = strtotime($lastDay); $where[] = ['create_time','between',[$firstTime,$lastTime]]; } $where[] = ['worker_id', '=', $this->userId]; if(isset($this->params['change_types']) && is_array($this->params['change_types'])){ $where[] = ['change_type','in',$this->params['change_types']]; } return $where; } public function lists():array { return MasterWorkerAccountLog::where($this->queryWhere()) ->field('sn,title,change_type,action,work_sn,change_amount,create_time') ->order(['id' => 'dasc']) ->append(['action_text']) //->limit($this->limitOffset, $this->limitLength) ->order(['create_time' => 'desc'])//时间排序 ->select() ->toArray(); } public function count(): int { return MasterWorkerAccountLog::where($this->queryWhere())->count(); } }