공통화 작업 및 워커 해더
This commit is contained in:
@@ -1338,4 +1338,66 @@ class Receipt extends BaseController
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function modifyPriceInfo(){
|
||||
try {
|
||||
$rcpt_sq = $this->request->getPost('rcpt_sq'); // 필수
|
||||
$rcpt_key = $this->request->getPost('rcpt_key'); // 필수
|
||||
$rcpt_no = $this->request->getPost('rcpt_no'); // 선택
|
||||
$trade_type = $this->request->getPost('trade_type'); // 거래구분
|
||||
$rcpt_product_info2 = $this->request->getPost('rcpt_product_info2'); // 보증금
|
||||
$rcpt_product_info3 = $this->request->getPost('rcpt_product_info3'); // 월세
|
||||
$rcpt_product_info4 = $this->request->getPost('rcpt_product_info4'); // 분양가
|
||||
$rcpt_product_info5 = $this->request->getPost('rcpt_product_info5'); // 프리미엄
|
||||
$rcpt_ptp_no = $this->request->getPost('rcpt_ptp_no'); // 단지정보
|
||||
$rcpt_hscp_no = $this->request->getPost('rcpt_hscp_no'); // 평형정보
|
||||
|
||||
// 거래유형에 따른 가격 정보 제한
|
||||
$return = limitHscpMarketPriceInfo($trade_type, $rcpt_hscp_no, $rcpt_ptp_no, $rcpt_product_info2);
|
||||
if (empty($return)){
|
||||
|
||||
}
|
||||
|
||||
if (empty($rcpt_sq) || empty($trade_type)) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '1',
|
||||
'msg' => '필수 파라미터가 누락되었습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$params = [
|
||||
'rcpt_sq' => $rcpt_sq,
|
||||
'rcpt_key' => $rcpt_key,
|
||||
'rcpt_no' => $rcpt_no,
|
||||
'trade_type' => $trade_type,
|
||||
'rcpt_product_info2' => $rcpt_product_info2,
|
||||
'rcpt_product_info3' => $rcpt_product_info3,
|
||||
'rcpt_product_info4' => $rcpt_product_info4,
|
||||
'rcpt_product_info5' => $rcpt_product_info5,
|
||||
'rcpt_ptp_no' => $rcpt_ptp_no,
|
||||
'rcpt_hscp_no' => $rcpt_hscp_no,
|
||||
];
|
||||
|
||||
$result = $this->model->modifyPriceInfo($params);
|
||||
|
||||
if (!$result['success']) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '1',
|
||||
'msg' => $result['msg'] ?? '가격 정보 수정 실패'
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => '가격 정보가 수정되었습니다.'
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
log_message('error', 'modifyPriceInfo error: ' . $e->getMessage());
|
||||
return $this->response->setJSON([
|
||||
'code' => '1',
|
||||
'msg' => '가격 정보 수정 중 에러가 발생했습니다: ' . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user