공통화 작업 및 워커 해더
This commit is contained in:
@@ -1,130 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\V2;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Controllers\V2\BaseV2Controller;
|
||||
use App\Libraries\FormValidation;
|
||||
use App\Libraries\MyUpload;
|
||||
use App\Libraries\NaverApiClient;
|
||||
use App\Models\common\CodeModel;
|
||||
use App\Models\results\M415Model;
|
||||
use App\Models\v2\M701Model;
|
||||
use App\Models\v2\M710Model;
|
||||
use Exception;
|
||||
use function PHPUnit\Framework\throwException;
|
||||
use App\Models\v2\M701Model;
|
||||
|
||||
class M701 extends BaseController
|
||||
class M701 extends BaseV2Controller
|
||||
{
|
||||
private $model, $codeModel;
|
||||
|
||||
public function __construct()
|
||||
protected function createModel()
|
||||
{
|
||||
$this->model = new M701Model();
|
||||
$this->codeModel = new CodeModel();
|
||||
return new M701Model();
|
||||
}
|
||||
|
||||
public function lists(): string
|
||||
protected function getCodeKeys(): array
|
||||
{
|
||||
|
||||
$codes = $this->codeModel->getCodeLists(['STEP_VERIFICATION', 'VRFCREQ_WAY', 'CP_ID', 'ARTICLE_TYPE']); // 코드조회
|
||||
$sido = $this->model->getAreaList(); // 지역조회
|
||||
$bonbu = $this->model->getBonbuList();
|
||||
$team = $this->model->getTeamList();
|
||||
$user = $this->model->getUserList();
|
||||
|
||||
$this->data['sido'] = $sido;
|
||||
$this->data['bonbu'] = $bonbu;
|
||||
$this->data['team'] = $team;
|
||||
$this->data['user'] = $user;
|
||||
$this->data['codes'] = $codes;
|
||||
|
||||
return view("pages/v2/m701/lists", $this->data);
|
||||
return ['STEP_VERIFICATION', 'VRFCREQ_WAY', 'CP_ID', 'ARTICLE_TYPE'];
|
||||
}
|
||||
|
||||
public function getResultList()
|
||||
protected function getViewName(): string
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
return 'pages/v2/m701/lists';
|
||||
}
|
||||
|
||||
$data = [
|
||||
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
|
||||
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
|
||||
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
|
||||
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
|
||||
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
|
||||
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
|
||||
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
|
||||
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
|
||||
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
|
||||
'srcSido' => $this->request->getGet('srcSido'), // 시도
|
||||
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
|
||||
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
|
||||
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||
'team' => $this->request->getGet('team'), // 팀
|
||||
'damdang' => $this->request->getGet('damdang'), // 담당
|
||||
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
|
||||
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
|
||||
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
|
||||
'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
|
||||
'reference_file_url_yn' => $this->request->getGet('reference_file_url_yn'), // 참고용
|
||||
'corp_own' => $this->request->getGet('corp_own'), // 법인
|
||||
protected function getSearchKeys(): array
|
||||
{
|
||||
return [
|
||||
'atcl_no',
|
||||
'stat_cd',
|
||||
'realtor_nm',
|
||||
'charger_gbn',
|
||||
'assign_yn',
|
||||
'receipt_sdate',
|
||||
'receipt_edate',
|
||||
'complete_sdate',
|
||||
'complete_edate',
|
||||
'srcSido',
|
||||
'srcGugun',
|
||||
'srcDong',
|
||||
'bonbu',
|
||||
'team',
|
||||
'damdang',
|
||||
'vrfcreq_way',
|
||||
'vrfc_type_sub',
|
||||
'rcpt_cpid',
|
||||
'rlet_type_cd',
|
||||
'reference_file_url_yn',
|
||||
'corp_own',
|
||||
];
|
||||
|
||||
$totalCount = $this->model->getTotalCount($data);
|
||||
|
||||
|
||||
$datas = $this->model->getResultList($start, $end, $data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// 엑셀 다운로드
|
||||
public function excel()
|
||||
{
|
||||
try {
|
||||
|
||||
$data = [
|
||||
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
|
||||
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
|
||||
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
|
||||
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
|
||||
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
|
||||
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
|
||||
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
|
||||
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
|
||||
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
|
||||
'srcSido' => $this->request->getGet('srcSido'), // 시도
|
||||
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
|
||||
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
|
||||
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||
'team' => $this->request->getGet('team'), // 팀
|
||||
'damdang' => $this->request->getGet('damdang'), // 담당
|
||||
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
|
||||
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
|
||||
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
|
||||
'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
|
||||
'reference_file_url_yn' => $this->request->getGet('reference_file_url_yn'), // 참고용
|
||||
'corp_own' => $this->request->getGet('corp_own'), // 법인
|
||||
];
|
||||
|
||||
$datas = $this->model->getExcelList($data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'data' => $datas,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$e->getPrevious()->getTraceAsString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 상세화면
|
||||
public function detail($id = null)
|
||||
{
|
||||
$id = (int) $id;
|
||||
@@ -1700,5 +1630,3 @@ class M701 extends BaseController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user