deptModel = new DeptModel(); } public function index() { } public function lists(): string { $this->schDateGb = $this->request->getPost('schDateGb') ?? '1'; $this->sdate = $this->request->getPost('sdate'); if (empty($this->sdate)) { $this->sdate = date('Y-m-01'); // 이번달 1일 } $this->edate = $this->request->getPost('edate'); if (empty($this->edate)) { $this->edate = date('Y-m-t'); // 이번달 말일 } $this->bonbu = $this->request->getPost('bonbu'); if (empty($this->bonbu)) { $this->bonbu = ''; } $this->dept_sq = $this->request->getPost('dept_sq'); if (empty($this->dept_sq)) { $this->dept_sq = ''; } $data = [ 'schDateGb' => $this->schDateGb, 'sdate' => $this->sdate, 'edate' => $this->edate, 'bonbu' => $this->bonbu, 'dept_sq' => $this->dept_sq, ]; $bonbu = $this->deptModel->getBonbuList(); $team = $this->deptModel->getTeamList(); $res = $this->deptModel->st_d01($data); return view("pages/results/dept/stats_d01", [ 'pBonbu' => $this->bonbu, 'pDeptSq' => $this->dept_sq, 'schDateGb' => $this->schDateGb, 'sdate' => $this->sdate, 'edate' => $this->edate, 'bonbu' => $bonbu, 'team' => $team, 'st_list' => $res, ]); } // 엑셀 다운로드 public function excel() { $data = [ 'schDateGb' => $this->request->getGet('schDateGb'), 'sdate' => $this->request->getGet('sdate'), 'edate' => $this->request->getGet('edate'), 'bonbu' => $this->request->getGet('bonbu'), 'dept_sq' => $this->request->getGet('dept_sq'), ]; $res = $this->deptModel->getExcelList($data); return $this->response->setJSON(body: [ 'data' => $res, ]); } }