['project_id'], '%like%' => ['send_company', 'accept_user'], ]; } /** * @notes 获取项目管理--收文管理列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/07 16:46 */ public function lists(): array { $params = $this->request->get(); $condition = []; if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ $condition[] = ['send_date','between',[strtotime($params['start_date'].' 00:00:00'),strtotime($params['end_date'].' 23:59:59')]]; } } return ManageAcceptDoc::where($this->searchWhere)->where($condition) ->field(['id', 'project_id', 'abstract', 'send_company', 'send_date', 'accept_user', 'accept_date']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($data){ $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); $data['project_name'] = $project['project_name']; }) ->toArray(); } /** * @notes 获取项目管理--收文管理数量 * @return int * @author likeadmin * @date 2024/03/07 16:46 */ public function count(): int { $params = $this->request->get(); $condition = []; if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ $condition[] = ['date','between',[strtotime($params['start_date'].' 00:00:00'),strtotime($params['end_date'].' 23:59:59')]]; } } return ManageAcceptDoc::where($this->searchWhere)->where($condition)->count(); } }