아파트평면도 엑셀업로드 추가
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
This commit is contained in:
@@ -84,6 +84,57 @@ class Ground extends BaseController
|
||||
|
||||
}
|
||||
|
||||
// 엑셀 업로드
|
||||
public function uploadExcel()
|
||||
{
|
||||
try {
|
||||
|
||||
$payload = $this->request->getJSON(true);
|
||||
$datas = $payload['datas'] ?? null;
|
||||
|
||||
if (count($datas) === 0) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => "데이터 없음",
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($datas as $data) {
|
||||
$rdate = date("Y-m-d H:i:s");
|
||||
|
||||
$params = [
|
||||
'hscp_no' => $data[1],
|
||||
'region_cd' => $data[2],
|
||||
'part_no' => $data[0],
|
||||
'apt_step' => 'S01',
|
||||
'addr' => $data[3] . ' ' . $data[4] . ' ' . $data[5],
|
||||
'addr2' => $data[6],
|
||||
'rcpt_hscp_nm' => $data[7],
|
||||
'apt_cate_nm' => $data[8],
|
||||
'pyeong_cnt' => $data[9],
|
||||
'rcpt_x' => $data[10],
|
||||
'rcpt_y' => $data[11],
|
||||
'ginsert_tm' => $rdate,
|
||||
];
|
||||
|
||||
// INSERT apt_ground
|
||||
$this->model->saveExcelUploadData($params);
|
||||
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 엑셀 다운로드
|
||||
public function excel()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user