Compare commits
2 Commits
32b869f05b
...
f17dc88f99
| Author | SHA1 | Date | |
|---|---|---|---|
| f17dc88f99 | |||
|
|
abf369dcd6 |
@@ -67,6 +67,13 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
|
|||||||
$routes->get('excel', 'Receipt::excel');
|
$routes->get('excel', 'Receipt::excel');
|
||||||
|
|
||||||
$routes->post('saveTel', 'Receipt::saveTel'); // 연락가능전화 저장
|
$routes->post('saveTel', 'Receipt::saveTel'); // 연락가능전화 저장
|
||||||
|
$routes->post('resGround', 'Receipt::resGround'); // 평면도요청 저장
|
||||||
|
$routes->post('assignRegist', 'Receipt::assignRegist'); // 예약확정 저장
|
||||||
|
$routes->post('requestMovie', 'Receipt::requestMovie'); // 동영상 촬영여부저장
|
||||||
|
$routes->post('requestMessage', 'Receipt::requestMessage'); // 중개사메모 저장
|
||||||
|
$routes->post('rsrvcancel', 'Receipt::rsrvcancel'); // 예약취소
|
||||||
|
$routes->post('sendSms', 'Receipt::sendSms'); // 문자발송
|
||||||
|
$routes->post('saveRecInfo', 'Receipt::saveRecInfo'); // 거주인정보저장
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,7 +82,7 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
|
|||||||
*/
|
*/
|
||||||
$routes->group('article/dept', static function ($routes) {
|
$routes->group('article/dept', static function ($routes) {
|
||||||
$routes->get('lists', 'Dept::lists');
|
$routes->get('lists', 'Dept::lists');
|
||||||
$routes->get('detail/(:num)', 'Dept::detail/$1');
|
$routes->get('detail/(:num)', 'Receipt::detail/$1');
|
||||||
|
|
||||||
$routes->get('getResultList', 'Dept::getResultList');
|
$routes->get('getResultList', 'Dept::getResultList');
|
||||||
$routes->get('excel', 'Dept::excel');
|
$routes->get('excel', 'Dept::excel');
|
||||||
@@ -89,7 +96,7 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
|
|||||||
*/
|
*/
|
||||||
$routes->group('article/record', static function ($routes) {
|
$routes->group('article/record', static function ($routes) {
|
||||||
$routes->get('lists', 'Record::lists');
|
$routes->get('lists', 'Record::lists');
|
||||||
$routes->get('detail/(:num)', 'Record::detail/$1');
|
$routes->get('detail/(:num)', 'Receipt::detail/$1');
|
||||||
|
|
||||||
$routes->get('getResultList', 'Record::getResultList');
|
$routes->get('getResultList', 'Record::getResultList');
|
||||||
$routes->get('excel', 'Record::excel');
|
$routes->get('excel', 'Record::excel');
|
||||||
|
|||||||
@@ -136,4 +136,52 @@ class Dept2 extends BaseController
|
|||||||
$e->getPrevious()->getTraceAsString();
|
$e->getPrevious()->getTraceAsString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 배정내역 excel
|
||||||
|
public function excel2()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'req_rec_yn' => 'Y',
|
||||||
|
'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
|
||||||
|
|
||||||
|
'sdate' => $this->request->getGet('sdate'), // 시작일
|
||||||
|
'edate' => $this->request->getGet('edate'), // 종료일
|
||||||
|
|
||||||
|
'rsrv_tm_ap' => $this->request->getGet('rsrv_tm_ap'), // 유형
|
||||||
|
'rsrv_sdate' => $this->request->getGet('rsrv_sdate'), // 시작일
|
||||||
|
'rsrv_edate' => $this->request->getGet('rsrv_edate'), // 종료일
|
||||||
|
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||||
|
'team' => $this->request->getGet('team'), // 팀
|
||||||
|
'user' => $this->request->getGet('user'), // 담당자
|
||||||
|
|
||||||
|
'sido' => $this->request->getGet('sido'), // 시도
|
||||||
|
'gugun' => $this->request->getGet('gugun'), // 시군구
|
||||||
|
'dong' => $this->request->getGet('dong'), // 읍면동
|
||||||
|
|
||||||
|
'ground_plan_yn' => $this->request->getGet('ground_plan_yn'), // 평면도유무
|
||||||
|
'ground_plan' => $this->request->getGet('ground_plan'), // 평면도요청
|
||||||
|
'direct_trad_yn' => $this->request->getGet('direct_trad_yn'), // 직거래
|
||||||
|
|
||||||
|
'isSiteVRVerification' => $this->request->getGet('isSiteVRVerification'), // 검증방식
|
||||||
|
'conf_img_yn' => $this->request->getGet('conf_img_yn'), // 홍보확인서 여부
|
||||||
|
|
||||||
|
'stat' => $this->request->getGet('stat'),
|
||||||
|
|
||||||
|
'srchType' => $this->request->getGet('srchType'), // 검색유형
|
||||||
|
'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getExcelList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
namespace App\Controllers\Article;
|
namespace App\Controllers\Article;
|
||||||
|
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
|
use App\Libraries\MyUpload;
|
||||||
use App\Models\article\ReceiptModel;
|
use App\Models\article\ReceiptModel;
|
||||||
use App\Models\common\CodeModel;
|
use App\Models\common\CodeModel;
|
||||||
|
|
||||||
@@ -146,29 +147,65 @@ class Receipt extends BaseController
|
|||||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
$codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE']); // 코드조회
|
$codes = $this->codeModel->getCodeLists(['TRADE_TYPE', 'RECEIPT_STATUS2', 'RECEIPT_STATUS3', 'SMS_MSG_TYPE', 'SMS_MSG_TYPE2']); // 코드조회
|
||||||
$bonbu = $this->model->getBonbuList();
|
$bonbu = $this->model->getBonbuList();
|
||||||
$team = $this->model->getTeamList();
|
$team = $this->model->getTeamList();
|
||||||
|
|
||||||
|
// sms 코드
|
||||||
|
$sms = [];
|
||||||
|
foreach ($codes as $c) {
|
||||||
|
if ($c['category'] === "SMS_MSG_TYPE2")
|
||||||
|
array_push($sms, $c);
|
||||||
|
}
|
||||||
|
|
||||||
$data = $this->model->getDetail($id);
|
$data = $this->model->getDetail($id);
|
||||||
$history = $this->model->getHistory($id);
|
$history = $this->model->getHistory($id);
|
||||||
|
|
||||||
$aptGround = $this->model->getAptGround($data['rcpt_dong']);
|
if ($data['rcpt_jibun_addr']) {
|
||||||
|
$dupleGroundPlan = $this->model->getDupleGP_na($id, $data['rcpt_sido'], $data['rcpt_gugun'], $data['rcpt_dong'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_li_addr'], $data['rcpt_jibun_addr'], $data['rcpt_etc_addr']);
|
||||||
|
} else {
|
||||||
|
$dupleGroundPlan = $this->model->getDupleGP($id, $data['rcpt_sido'], $data['rcpt_gugun'], $data['rcpt_dong'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_ho']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$aptGround = $this->model->getAptGround($data['rcpt_dong'] ?? '');
|
||||||
|
|
||||||
|
|
||||||
|
// 이미지 파일리스트
|
||||||
|
$images = $this->model->getImageList2($data['rsrv_sq']);
|
||||||
|
$imgs_count = $this->model->getImageCountByType($data['rsrv_sq']);
|
||||||
|
$imgs_count = convertArrayToHashTable($imgs_count, 'img_type', 'img_cnt');
|
||||||
|
|
||||||
|
//녹취파일
|
||||||
|
$record = $this->model->getRecordInfo($data['rsrv_sq']);
|
||||||
|
|
||||||
// 시간대별통계
|
// 시간대별통계
|
||||||
$tmCount = $this->model->getUsrRsrvDateTmCount($id);
|
$tmCount = $this->model->getUsrRsrvDateTmCount($id);
|
||||||
|
|
||||||
|
// 체크리스트 조회
|
||||||
|
if ($data['exp_photo_yn'] === "N") {
|
||||||
|
$result_check = $this->model->getChecklist($data['rsrv_sq']);
|
||||||
|
} else {
|
||||||
|
$result_check = [];
|
||||||
|
}
|
||||||
|
|
||||||
$this->data['codes'] = $codes;
|
$this->data['codes'] = $codes;
|
||||||
$this->data['bonbu'] = $bonbu;
|
$this->data['bonbu'] = $bonbu;
|
||||||
$this->data['team'] = $team;
|
$this->data['team'] = $team;
|
||||||
|
$this->data['sms'] = $sms;
|
||||||
|
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
$this->data['history'] = $history;
|
$this->data['history'] = $history;
|
||||||
|
|
||||||
|
$this->data['dupleGroundPlan'] = $dupleGroundPlan;
|
||||||
$this->data['apt_ground'] = $aptGround;
|
$this->data['apt_ground'] = $aptGround;
|
||||||
|
|
||||||
|
$this->data['images'] = $images;
|
||||||
|
$this->data['imgs_count'] = $imgs_count;
|
||||||
|
|
||||||
|
$this->data['record'] = $record;
|
||||||
|
|
||||||
$this->data['tmCount'] = $tmCount;
|
$this->data['tmCount'] = $tmCount;
|
||||||
|
$this->data['result_check'] = $result_check;
|
||||||
|
|
||||||
|
|
||||||
return view("pages/article/receipt/detail", $this->data);
|
return view("pages/article/receipt/detail", $this->data);
|
||||||
@@ -185,6 +222,233 @@ class Receipt extends BaseController
|
|||||||
$this->model->saveTel($tel);
|
$this->model->saveTel($tel);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 평면도요청 저장
|
||||||
|
public function resGround()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$rcpt_sq = $this->request->getPost('rcpt_sq');
|
||||||
|
$ground_plan = $this->request->getPost('ground_plan');
|
||||||
|
|
||||||
|
$this->model->saveGround($rcpt_sq, $ground_plan);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 예약확정 저장
|
||||||
|
public function assignRegist()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 동영상촬영여부 저장
|
||||||
|
public function requestMovie()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$rcpt_sq = $this->request->getPost('rcpt_sq');
|
||||||
|
$rsrv_sq = $this->request->getPost('rsrv_sq');
|
||||||
|
$exp_movie_yn = $this->request->getPost('exp_movie_yn');
|
||||||
|
|
||||||
|
$this->model->saveRequestMovie($rcpt_sq, $rsrv_sq, $exp_movie_yn);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중개사메모 저장
|
||||||
|
public function requestMessage()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$rcpt_sq = $this->request->getPost('rcpt_sq');
|
||||||
|
$rsrv_sq = $this->request->getPost('rsrv_sq');
|
||||||
|
$request_msg = $this->request->getPost('request_msg');
|
||||||
|
|
||||||
|
$this->model->saveRequestMessage($rcpt_sq, $rsrv_sq, $request_msg);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 예약취소
|
||||||
|
public function rsrvcancel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 문자발송
|
||||||
|
public function sendSms()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$rcpt_key = $this->request->getPost('rcpt_key');
|
||||||
|
$rcpt_sq = $this->request->getPost('rcpt_sq');
|
||||||
|
$rsrv_sq = $this->request->getPost('rsrv_sq');
|
||||||
|
$cd = $this->request->getPost('cd');
|
||||||
|
|
||||||
|
$send_phone = "1600-5749";
|
||||||
|
$phone = $this->request->getPost('phone');
|
||||||
|
$content = $this->request->getPost('content');
|
||||||
|
$send_nm = session('usr_nm');
|
||||||
|
|
||||||
|
$data = $this->model->getDetail($rcpt_key);
|
||||||
|
|
||||||
|
$dest_name = "";
|
||||||
|
if ($cd == "S7" || $cd == "S14") {
|
||||||
|
$dest_name = "(거주인)" . $data['rec_nm'];
|
||||||
|
} else {
|
||||||
|
$dest_name = "(중개인)" . $data['agent_nm'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->model->sendSms($phone, "", $send_phone, $send_nm, $dest_name, $rsrv_sq, $rcpt_sq, $cd, $data);
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 거주인정보저장
|
||||||
|
public function saveRecInfo()
|
||||||
|
{
|
||||||
|
$lib = new MyUpload();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$rcpt_sq = $this->request->getPost('rcpt_sq');
|
||||||
|
$rcpt_key = $this->request->getPost('rcpt_key');
|
||||||
|
$rsrv_sq = $this->request->getPost('rsrv_sq');
|
||||||
|
|
||||||
|
$rec_tel1 = $this->request->getPost('rec_tel1');
|
||||||
|
$rec_tel2 = $this->request->getPost('rec_tel2');
|
||||||
|
$rec_tel3 = $this->request->getPost('rec_tel3');
|
||||||
|
$rec_tel = $rec_tel1 . '-' . $rec_tel2 . '-' . $rec_tel3;
|
||||||
|
|
||||||
|
$rec_nm = $this->request->getPost('rec_nm');
|
||||||
|
$rec_remark = $this->request->getPost('rec_remark');
|
||||||
|
|
||||||
|
$file = $this->request->getFile('rec_file');
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'rcpt_sq' => $rcpt_sq,
|
||||||
|
'rsrv_sq' => $rsrv_sq,
|
||||||
|
'rcpt_key' => $rcpt_key,
|
||||||
|
'rec_tel' => $rec_tel,
|
||||||
|
'rec_nm' => $rec_nm,
|
||||||
|
'rec_remark' => $rec_remark,
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||||
|
|
||||||
|
$uploadPath = "/upload/result/" . $rsrv_sq . "/";
|
||||||
|
|
||||||
|
$arrUploadfile = [];
|
||||||
|
if ($file->isValid() && !$file->hasMoved()) {
|
||||||
|
$uploadData = $lib->do_upload2($file, $uploadPath);
|
||||||
|
|
||||||
|
if ($uploadData !== false) {
|
||||||
|
$arrUploadfile[] = $uploadData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($arrUploadfile)) {
|
||||||
|
foreach ($arrUploadfile as $key => $uploadFile) {
|
||||||
|
$data['file'] = [
|
||||||
|
'orig_name' => $uploadFile['origin_name'],
|
||||||
|
'new_name' => $uploadFile['file_name'],
|
||||||
|
'file_path' => $uploadPath, // 필요에 따라 상대경로로만 저장
|
||||||
|
'ext' => '.' . $uploadFile['ext'],
|
||||||
|
'size' => $file->getSize(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->model->saveRecInfo($data);
|
||||||
|
|
||||||
return $this->response->setJSON([
|
return $this->response->setJSON([
|
||||||
'code' => '0',
|
'code' => '0',
|
||||||
'msg' => 'success'
|
'msg' => 'success'
|
||||||
|
|||||||
@@ -33,6 +33,108 @@ class Common
|
|||||||
return $pagination;
|
return $pagination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 워터마킹하기
|
||||||
|
*/
|
||||||
|
public function watermarking($imagePath, $watermark_info, $wmText, $cpid, $key = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
$CI =& get_instance();
|
||||||
|
|
||||||
|
$CI->load->library('upload');
|
||||||
|
|
||||||
|
$wmImagePath = ''; // 워터마크 이미지의 경로
|
||||||
|
$wmSpaceHeihgt = 0; // 워터마크 이미지 하단 공백
|
||||||
|
$wmFont = ''; // 워터마크 텍스트(글꼴)
|
||||||
|
$wmFontSize = 13; // 워터마크 텍스트(글꼴) 크기
|
||||||
|
$wmTextHeight = 17; // 워터마크 텍스트의 높이
|
||||||
|
$wmTextColor = '#FFFFFF'; // 워터마크 텍스트의 칼라
|
||||||
|
$wmTextAlpha = 0.5; // 워터마크 텍스트 투명도
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
// $img = new Imagick($imagePath);
|
||||||
|
$img = new \Imagick();
|
||||||
|
$img->readImageBlob($imagePath);
|
||||||
|
|
||||||
|
$hImg = $img->getImageHeight();
|
||||||
|
$wImg = $img->getImageWidth();
|
||||||
|
|
||||||
|
foreach ($watermark_info as $watermark) {
|
||||||
|
if (strtolower($watermark['cpid']) == strtolower($cpid)) {
|
||||||
|
$img_w_min = intval($watermark['img_width_min']);
|
||||||
|
$img_w_max = intval($watermark['img_width_max']);
|
||||||
|
if (($img_w_min <= $wImg) and ($img_w_max >= $wImg)) {
|
||||||
|
$wmImagePath = $watermark['wm_img_path'];
|
||||||
|
$wmSpaceHeihgt = $watermark['wm_space'];
|
||||||
|
$wmFont = $watermark['text_font'];
|
||||||
|
$wmFontSize = intval($watermark['text_size']);
|
||||||
|
$wmTextHeight = intval($watermark['text_pixel']);
|
||||||
|
$wmTextColor = $watermark['text_color'];
|
||||||
|
$wmTextAlpha = $watermark['text_opacity'] / 100;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($wmImagePath))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (substr($wmImagePath, 0, 1) == '/') {
|
||||||
|
$wmImagePath = substr($wmImagePath, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// echo FCPATH.$wmImagePath;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$wm = new Imagick(FCPATH . $wmImagePath);
|
||||||
|
$hWm = $wm->getImageHeight();
|
||||||
|
$wWm = $wm->getImageWidth();
|
||||||
|
|
||||||
|
$wmImgLeft = floor(($wImg - $wWm) / 2);
|
||||||
|
$wmImgTop = floor(($hImg - $hWm - $wmSpaceHeihgt - $wmTextHeight) / 2); // 워터마크 이미지의 위치 top
|
||||||
|
$wmTxtTop = $wmImgTop + $hWm + $wmSpaceHeihgt + ($wmTextHeight * 0.6); // 워터마크 텍스트의 위치
|
||||||
|
|
||||||
|
$img->compositeImage($wm, imagick::COMPOSITE_OVER, $wmImgLeft, $wmImgTop, imagick::ALIGN_CENTER);
|
||||||
|
$wm->destroy();
|
||||||
|
|
||||||
|
$draw = new \ImagickDraw();
|
||||||
|
|
||||||
|
$wmFont = BASEPATH . 'fonts/' . $wmFont;
|
||||||
|
$draw->setFont($wmFont);
|
||||||
|
|
||||||
|
$draw->setFontSize($wmFontSize);
|
||||||
|
$draw->setFillColor(new ImagickPixel($wmTextColor));
|
||||||
|
// $draw->setFillAlpha( $wmTextAlpha );
|
||||||
|
$draw->setFillOpacity($wmTextAlpha); // 워터마크 텍스트 투명도 설정
|
||||||
|
$draw->setTextAlignment(2); // center
|
||||||
|
$draw->setStrokeAntialias(1);
|
||||||
|
$draw->setStrokeWidth(1);
|
||||||
|
$draw->setStrokeColor(new ImagickPixel('#000000'));
|
||||||
|
// $draw->setStrokeAlpha(0.1);
|
||||||
|
$draw->setStrokeOpacity(0.1);
|
||||||
|
$draw->annotation($wImg / 2, $wmTxtTop, $wmText);
|
||||||
|
|
||||||
|
$img->drawImage($draw);
|
||||||
|
$draw->destroy();
|
||||||
|
|
||||||
|
// $img->writeImage();
|
||||||
|
|
||||||
|
$watermark_img = $img->getImageBlob();
|
||||||
|
|
||||||
|
$CI->upload->upload_object_storage_imagick($key, $watermark_img);
|
||||||
|
$img->destroy();
|
||||||
|
|
||||||
|
// $object_upload = $this->upload->upload_object_storage($imagePath , $imagePath , 'data');
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 서버상의 위치를 웹상의 위치로 변경한다...
|
* 서버상의 위치를 웹상의 위치로 변경한다...
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class DeptModel extends Model
|
|||||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$builder->where('a.isSiteVRVerification', 'N');
|
// $builder->where('a.isSiteVRVerification', 'N');
|
||||||
|
|
||||||
// 접수일자
|
// 접수일자
|
||||||
/*
|
/*
|
||||||
@@ -228,10 +228,7 @@ class DeptModel extends Model
|
|||||||
$builder->groupStart()
|
$builder->groupStart()
|
||||||
->like('a.agent_nm', $data['srchTxt'])
|
->like('a.agent_nm', $data['srchTxt'])
|
||||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||||
->groupEnd();
|
->orLike('a.agent_head_tel', $data['srchTxt'])
|
||||||
|
|
||||||
$builder->groupStart()
|
|
||||||
->like('a.agent_head_tel', $data['srchTxt'])
|
|
||||||
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
||||||
->groupEnd();
|
->groupEnd();
|
||||||
}
|
}
|
||||||
@@ -277,7 +274,7 @@ class DeptModel extends Model
|
|||||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$builder->where('a.isSiteVRVerification', 'N');
|
// $builder->where('a.isSiteVRVerification', 'N');
|
||||||
|
|
||||||
// 접수일자
|
// 접수일자
|
||||||
/*
|
/*
|
||||||
@@ -418,7 +415,7 @@ class DeptModel extends Model
|
|||||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$builder->where('b.req_rec_yn', 'Y');
|
// $builder->where('b.req_rec_yn', 'Y');
|
||||||
|
|
||||||
// 접수일자
|
// 접수일자
|
||||||
/*
|
/*
|
||||||
@@ -662,7 +659,7 @@ class DeptModel extends Model
|
|||||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$builder->where('b.req_rec_yn', 'Y');
|
// $builder->where('b.req_rec_yn', 'Y');
|
||||||
|
|
||||||
// 접수일자
|
// 접수일자
|
||||||
/*
|
/*
|
||||||
@@ -769,10 +766,7 @@ class DeptModel extends Model
|
|||||||
$builder->groupStart()
|
$builder->groupStart()
|
||||||
->like('a.agent_nm', $data['srchTxt'])
|
->like('a.agent_nm', $data['srchTxt'])
|
||||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||||
->groupEnd();
|
->orLike('a.agent_head_tel', $data['srchTxt'])
|
||||||
|
|
||||||
$builder->groupStart()
|
|
||||||
->like('a.agent_head_tel', $data['srchTxt'])
|
|
||||||
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
||||||
->groupEnd();
|
->groupEnd();
|
||||||
}
|
}
|
||||||
@@ -845,97 +839,32 @@ class DeptModel extends Model
|
|||||||
|
|
||||||
$builder = $this->db->table('receipt a');
|
$builder = $this->db->table('receipt a');
|
||||||
|
|
||||||
$builder->select("a.rcpt_sq
|
$builder->select("
|
||||||
,a.comp_sq
|
CASE WHEN b.result_cd1 = '90' THEN get_code_name('RECEIPT_STATUS2', b.result_cd2) ELSE '' END AS '매물ID',
|
||||||
,a.rcpt_rating
|
a.rcpt_atclno AS '예약일자',
|
||||||
,a.rcpt_key
|
b.rsrv_tm_hour AS '중개사명',
|
||||||
,a.rcpt_atclno
|
b.photo_save_dt AS '대표전화',
|
||||||
,a.rcpt_type
|
a.agent_contact_tel AS '담당자전화',
|
||||||
,a.rcpt_product
|
CASE
|
||||||
,a.rcpt_product_nm
|
WHEN IFNULL(a.rcpt_jibun_addr, '') = '' THEN
|
||||||
,a.rcpt_product_area
|
CASE
|
||||||
,a.rcpt_product_price
|
WHEN IFNULL(a.rcpt_hscp_nm, '') = '' THEN
|
||||||
,a.rcpt_product_info1
|
CONCAT(c.region_nm, ' ', a.rcpt_dtl_addr, ' ', a.rcpt_ho)
|
||||||
,a.rcpt_product_info2
|
ELSE
|
||||||
,a.rcpt_product_info3
|
CONCAT(c.region_nm, ' ', a.rcpt_hscp_nm, ' ', a.rcpt_dtl_addr, ' ', a.rcpt_ho)
|
||||||
,a.rcpt_product_info4
|
END
|
||||||
,a.rcpt_product_info5
|
ELSE
|
||||||
,a.rcpt_ptp_nm
|
CASE
|
||||||
,a.rcpt_office
|
WHEN IFNULL(a.rcpt_li_addr, '') != '' THEN
|
||||||
,(CASE WHEN a.rcpt_agent IS NULL THEN 'N' ELSE 'Y' END) as rcpt_agent
|
CONCAT(c.region_nm, ' ', a.rcpt_li_addr, ' ', a.rcpt_jibun_addr, ' ', a.rcpt_etc_addr)
|
||||||
,a.rcpt_sido
|
ELSE
|
||||||
,a.rcpt_gugun
|
CONCAT(c.region_nm, ' ', a.rcpt_jibun_addr, ' ', a.rcpt_etc_addr)
|
||||||
,a.rcpt_dong
|
END
|
||||||
,IFNULL(a.rcpt_hscp_nm, '') AS rcpt_hscp_nm
|
END AS '주소',
|
||||||
,IFNULL(a.rcpt_ho, '') AS rcpt_ho
|
a.rcpt_product_nm AS '매물종류',
|
||||||
,a.rcpt_dtl_addr
|
a.rcpt_product_info1 AS '거래구분',
|
||||||
,a.rcpt_li_addr
|
u.usr_nm AS '담당자',
|
||||||
,a.rcpt_jibun_addr
|
b.request_msg AS '중개사 요청사항'");
|
||||||
,IFNULL(a.rcpt_etc_addr, '') AS rcpt_etc_addr
|
|
||||||
,a.rcpt_floor
|
|
||||||
,a.rcpt_tm
|
|
||||||
,a.rcpt_stat
|
|
||||||
,a.rcpt_x
|
|
||||||
,a.rcpt_y
|
|
||||||
,a.rcpt_living_yn
|
|
||||||
,a.cust_nm
|
|
||||||
,a.cust_tel1
|
|
||||||
,a.cust_tel2
|
|
||||||
,a.cust_zip
|
|
||||||
,a.cust_addr1
|
|
||||||
,a.cust_addr2
|
|
||||||
,a.remark
|
|
||||||
,a.agent_id
|
|
||||||
,a.agent_nm
|
|
||||||
,a.agent_head
|
|
||||||
,a.agent_head_tel
|
|
||||||
,a.agent_contact
|
|
||||||
,a.agent_contact_tel
|
|
||||||
,IFNULL(a.agent_tel, '') AS agent_tel
|
|
||||||
,a.sply_spc
|
|
||||||
,a.excls_spc
|
|
||||||
,a.room_cnt
|
|
||||||
,a.exp_spc_yn
|
|
||||||
,a.agent_fax
|
|
||||||
,DATE_FORMAT(COALESCE(b.rsrv_date, a.rsrv_date), '%Y-%m-%d') AS rsrv_date
|
|
||||||
,COALESCE(b.rsrv_tm_ap, a.rsrv_tm_ap) as rsrv_tm_ap
|
|
||||||
,a.insert_usr
|
|
||||||
,a.insert_tm
|
|
||||||
,a.update_usr
|
|
||||||
,a.update_tm
|
|
||||||
,a.svc_type1
|
|
||||||
,a.svc_type2
|
|
||||||
,a.reconf_yn
|
|
||||||
,f.cd_nm as trade_type_nm
|
|
||||||
,b.rsrv_sq
|
|
||||||
,b.dept_sq
|
|
||||||
,b.usr_sq
|
|
||||||
,b.rsrv_tm_hour
|
|
||||||
,b.result_cd1
|
|
||||||
,b.result_cd2
|
|
||||||
,b.result_msg
|
|
||||||
,b.request_msg
|
|
||||||
,b.photo_save_dt
|
|
||||||
,b.rsrv_delay_dt
|
|
||||||
,b.rsrv_cplt_dt
|
|
||||||
,b.check_dt
|
|
||||||
,b.check_cplt_dt
|
|
||||||
,b.record_cplt_dt
|
|
||||||
,get_code_name('RECEIPT_STATUS1', substring(a.rcpt_stat, 1, 2)) AS rcpt_stat_nm
|
|
||||||
,c.region_nm as addr
|
|
||||||
,b.result_save_dt
|
|
||||||
,u.usr_nm
|
|
||||||
,d.dept_nm
|
|
||||||
,a.exp_photo_yn
|
|
||||||
,a.ground_plan
|
|
||||||
,CASE (SELECT COUNT(1) FROM result_imgs WHERE rsrv_sq=b.rsrv_sq AND img_type = 'I1' AND use_yn = 'Y') WHEN 0 THEN 'N' ELSE 'Y' END conf_img_yn
|
|
||||||
,CASE (SELECT COUNT(1) FROM result_imgs WHERE rsrv_sq=b.rsrv_sq AND img_type = 'I5' AND use_yn = 'Y') WHEN 0 THEN 'N' ELSE 'Y' END ground_plan_yn
|
|
||||||
,a.exp_movie_yn
|
|
||||||
,a.direct_trad_yn
|
|
||||||
,a.sellr_nm
|
|
||||||
,a.sellr_tel_no
|
|
||||||
,a.isSiteVRVerification
|
|
||||||
,a.isPromotionApply");
|
|
||||||
|
|
||||||
$builder->join('result b', 'a.rcpt_sq = b.rcpt_sq', 'left');
|
$builder->join('result b', 'a.rcpt_sq = b.rcpt_sq', 'left');
|
||||||
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
$builder->join('region_codes c', 'a.rcpt_dong = c.region_cd', 'inner');
|
||||||
@@ -958,7 +887,7 @@ class DeptModel extends Model
|
|||||||
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$builder->where('b.req_rec_yn', 'Y');
|
// $builder->where('b.req_rec_yn', 'Y');
|
||||||
|
|
||||||
// 접수일자
|
// 접수일자
|
||||||
/*
|
/*
|
||||||
@@ -1065,10 +994,7 @@ class DeptModel extends Model
|
|||||||
$builder->groupStart()
|
$builder->groupStart()
|
||||||
->like('a.agent_nm', $data['srchTxt'])
|
->like('a.agent_nm', $data['srchTxt'])
|
||||||
->orLike('a.sellr_nm', $data['srchTxt'])
|
->orLike('a.sellr_nm', $data['srchTxt'])
|
||||||
->groupEnd();
|
->orLike('a.agent_head_tel', $data['srchTxt'])
|
||||||
|
|
||||||
$builder->groupStart()
|
|
||||||
->like('a.agent_head_tel', $data['srchTxt'])
|
|
||||||
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
->orLike('a.sellr_tel_no', $data['srchTxt'])
|
||||||
->groupEnd();
|
->groupEnd();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Models\article;
|
namespace App\Models\article;
|
||||||
|
|
||||||
|
use App\Models\common\CodeModel;
|
||||||
use CodeIgniter\Model;
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
class ReceiptModel extends Model
|
class ReceiptModel extends Model
|
||||||
@@ -1182,9 +1183,79 @@ class ReceiptModel extends Model
|
|||||||
return $builder->get()->getRowArray();
|
return $builder->get()->getRowArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDupleGP($rcpt_key, $rcpt_sido, $rcpt_gugun, $rcpt_dong, $rcpt_hscp_nm, $rcpt_dtl_addr, $rcpt_ho)
|
||||||
|
{
|
||||||
|
$sql = "select rcpt_sq, c.rcpt_key, c.photo_save_dt from" .
|
||||||
|
" (select a.rcpt_sq, b.rsrv_sq, a.rcpt_key, b.photo_save_dt " .
|
||||||
|
" from receipt a " .
|
||||||
|
" LEFT OUTER JOIN result b ON b.rcpt_sq = a.rcpt_sq " .
|
||||||
|
" where a.rcpt_sido = ? " .
|
||||||
|
" and a.rcpt_gugun = ? " .
|
||||||
|
" and a.rcpt_dong = ? " .
|
||||||
|
" and a.rcpt_hscp_nm = ? " .
|
||||||
|
" and a.rcpt_dtl_addr = ? " .
|
||||||
|
" and a.rcpt_ho = ? " .
|
||||||
|
" and a.insert_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH) " .
|
||||||
|
" and a.rcpt_key != ? " .
|
||||||
|
" and b.result_cd3 = 600000) c " .
|
||||||
|
" LEFT OUTER JOIN result_imgs d ON c.rsrv_sq = d.rsrv_sq " .
|
||||||
|
" where d.img_type = 'I5'";
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
$rcpt_sido,
|
||||||
|
$rcpt_gugun,
|
||||||
|
$rcpt_dong,
|
||||||
|
$rcpt_hscp_nm,
|
||||||
|
$rcpt_dtl_addr,
|
||||||
|
$rcpt_ho,
|
||||||
|
$rcpt_key
|
||||||
|
];
|
||||||
|
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
return $res->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDupleGP_na($rcpt_key, $rcpt_sido, $rcpt_gugun, $rcpt_dong, $rcpt_hscp_nm, $rcpt_dtl_addr, $rcpt_li_addr, $rcpt_jibun_addr, $rcpt_etc_addr)
|
||||||
|
{
|
||||||
|
$sql = "select rcpt_sq, c.rcpt_key, c.photo_save_dt from" .
|
||||||
|
" (select a.rcpt_sq, b.rsrv_sq, a.rcpt_key, b.photo_save_dt " .
|
||||||
|
" from receipt a " .
|
||||||
|
" LEFT OUTER JOIN result b ON b.rcpt_sq = a.rcpt_sq " .
|
||||||
|
" where a.rcpt_sido = ? " .
|
||||||
|
" and a.rcpt_gugun = ? " .
|
||||||
|
" and a.rcpt_dong = ? " .
|
||||||
|
" and a.rcpt_hscp_nm = ? " .
|
||||||
|
" and a.rcpt_li_addr = ? " .
|
||||||
|
" and a.rcpt_jibun_addr = ? " .
|
||||||
|
" and a.rcpt_etc_addr = ? " .
|
||||||
|
" and a.insert_tm >= DATE_ADD(CURDATE(), INTERVAL -3 MONTH) " .
|
||||||
|
" and a.rcpt_key != ? " .
|
||||||
|
" and b.result_cd3 = 600000) c " .
|
||||||
|
" LEFT OUTER JOIN result_imgs d ON c.rsrv_sq = d.rsrv_sq " .
|
||||||
|
" where d.img_type = 'I5'";
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
$rcpt_sido,
|
||||||
|
$rcpt_gugun,
|
||||||
|
$rcpt_dong,
|
||||||
|
$rcpt_hscp_nm,
|
||||||
|
isset($rpct_li_addr) ? $rpct_li_addr : '',
|
||||||
|
$rcpt_jibun_addr,
|
||||||
|
$rcpt_etc_addr,
|
||||||
|
$rcpt_key
|
||||||
|
];
|
||||||
|
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
return $res->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
// 정보변경이력
|
// 정보변경이력
|
||||||
public function getHistory($id)
|
public function getHistory($id)
|
||||||
{
|
{
|
||||||
|
$sql = "SELECT rcpt_sq FROM receipt WHERE rcpt_key = ?";
|
||||||
|
$query = $query = $this->db->query($sql, [$id]);
|
||||||
|
$rcpt_sq = $query->getRow()->rcpt_sq;
|
||||||
|
|
||||||
$sql = "SELECT seq" .
|
$sql = "SELECT seq" .
|
||||||
" ,rcpt_sq" .
|
" ,rcpt_sq" .
|
||||||
" ,rcpt_stat" .
|
" ,rcpt_stat" .
|
||||||
@@ -1199,7 +1270,7 @@ class ReceiptModel extends Model
|
|||||||
" WHERE rcpt_sq = ?" .
|
" WHERE rcpt_sq = ?" .
|
||||||
" ORDER BY changed_tm DESC";
|
" ORDER BY changed_tm DESC";
|
||||||
|
|
||||||
$data = [$id];
|
$data = [$rcpt_sq];
|
||||||
$query = $this->db->query($sql, $data);
|
$query = $this->db->query($sql, $data);
|
||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
@@ -1254,6 +1325,60 @@ class ReceiptModel extends Model
|
|||||||
return $query2->getResultArray();
|
return $query2->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 체크리스트 결과 조회
|
||||||
|
public function getChecklist($rsrv_sq)
|
||||||
|
{
|
||||||
|
$sql = "select rsrv_sq, elevator_yn, maintenance_fee, elevator_cctv_yn, building_in_cctv_yn, building_ou_cctv_yn, heating_type, security_dept_yn, parking_lot_yn, interphone_yn, building_security_yn, window_direction, living_room_yn, balcony_yn, balcony_ext_yn, restroom_cnt, bath_yn, showerbooth_yn, utility_yn, built_in_chest_yn, airconditioner_yn, shoe_chest_yn, dress_room_yn, gas_stove_yn, refrigerator_yn, sink_yn, washing_machine_yn, insert_usr, insert_tm from result_check where rsrv_sq = ?";
|
||||||
|
$data = [$rsrv_sq];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImageList2($rsrv_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT * " .
|
||||||
|
" FROM result_imgs" .
|
||||||
|
" WHERE rsrv_sq = ?" .
|
||||||
|
" AND use_yn = 'Y'" .
|
||||||
|
" ORDER BY rsrv_sq, view_odr";
|
||||||
|
|
||||||
|
$data = [$rsrv_sq];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImageCountByType($rsrv_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT img_type, COUNT(*) img_cnt" .
|
||||||
|
" FROM result_imgs" .
|
||||||
|
" WHERE rsrv_sq = ?" .
|
||||||
|
" AND use_yn = 'Y'" .
|
||||||
|
" GROUP BY img_type";
|
||||||
|
$data = [$rsrv_sq];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 녹취파일정보
|
||||||
|
public function getRecordInfo($rsrv_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT record_sq, rsrv_sq, use_yn, record_path, record_filenm, record_orignm, record_size, record_tel, record_nm, record_dt, remark, insert_usr, insert_tm, update_usr, update_tm" .
|
||||||
|
" FROM result_record" .
|
||||||
|
" WHERE rsrv_sq = ?" .
|
||||||
|
" AND record_sq = (SELECT MAX(record_sq)" .
|
||||||
|
" FROM result_record" .
|
||||||
|
" WHERE rsrv_sq = ?)";
|
||||||
|
$data = array(
|
||||||
|
$rsrv_sq,
|
||||||
|
$rsrv_sq
|
||||||
|
);
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
// 연락처 저장
|
// 연락처 저장
|
||||||
public function saveTel($rcpt_sq, $tel)
|
public function saveTel($rcpt_sq, $tel)
|
||||||
{
|
{
|
||||||
@@ -1287,6 +1412,187 @@ class ReceiptModel extends Model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 평면도요청 저장
|
||||||
|
public function saveGround($rcpt_sq, $ground_plan)
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$sql = "UPDATE receipt" .
|
||||||
|
" SET ground_plan = ?" .
|
||||||
|
" WHERE rcpt_sq = ?";
|
||||||
|
|
||||||
|
$data = [$ground_plan, $rcpt_sq];
|
||||||
|
|
||||||
|
if ($this->db->query($sql, $data) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 동영상촬영여부 저장
|
||||||
|
public function saveRequestMovie($rcpt_sq, $rsrv_sq, $exp_movie_yn)
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
$sql = "SELECT a.result_cd3, b.exp_movie_yn FROM result a INNER JOIN receipt b ON b.rcpt_sq = a.rcpt_sq WHERE rsrv_sq = ?";
|
||||||
|
$data = [$rsrv_sq];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
$sql = "UPDATE receipt" .
|
||||||
|
" SET exp_movie_yn = ?" .
|
||||||
|
" WHERE rcpt_sq = ?";
|
||||||
|
$data = [$exp_movie_yn, $rcpt_sq];
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->db->query($sql, $data) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->saveChangedHistory($rcpt_sq, $row['result_cd3'], 'C24', $usr_id, $row['exp_movie_yn'] . ' => ' . $exp_movie_yn);
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중개사메모 저장
|
||||||
|
public function saveRequestMessage($rcpt_sq, $rsrv_sq, $request_msg)
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
if (empty($rsrv_sq)) {
|
||||||
|
$sql = "SELECT rsrv_sq FROM result WHERE rcpt_sq = ? ORDER BY rsrv_sq DESC LIMIT 1";
|
||||||
|
$data = [$rcpt_sq];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getResultArray();
|
||||||
|
|
||||||
|
$rsrv_sq = $row['rsrv_sq'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT result_cd3, request_msg FROM result WHERE rsrv_sq = ?";
|
||||||
|
$data = [$rsrv_sq];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getResultArray();
|
||||||
|
|
||||||
|
$sql = "UPDATE result" .
|
||||||
|
" SET request_msg = ?" .
|
||||||
|
" WHERE rsrv_sq = ?" .
|
||||||
|
" AND rcpt_sq = ?";
|
||||||
|
$data = [
|
||||||
|
'request_msg' => $request_msg,
|
||||||
|
'rsrv_sq' => $rsrv_sq,
|
||||||
|
'rcpt_sq' => $rcpt_sq
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->db->query($sql, $data) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$memo = "메모변경";
|
||||||
|
$this->saveChangedHistory($rcpt_sq, $row['result_cd3'], 'C19', $usr_id, $memo);
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 문자발송
|
||||||
|
public function sendSms($dest_phone, $dest_name, $send_phone, $send_name, $msg_type, $rsrv_sq, $rcpt_sq, $cd, $data)
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "SELECT DATE_FORMAT(NOW(), '%Y%m%d-%H%i%s') as cmid, NOW() as currDttm FROM DUAL";
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
$cmid = $row['cmid'];
|
||||||
|
$currDate = $row['currDttm'];
|
||||||
|
|
||||||
|
$category = 'SMS_MSG_TYPE';
|
||||||
|
if ($data['comp_sq'] == '2') {
|
||||||
|
$category = 'SMS_MSG_TYPE2';
|
||||||
|
}
|
||||||
|
|
||||||
|
$codeModel = new CodeModel();
|
||||||
|
$code = $codeModel->getCodeDetail($category, $cd);
|
||||||
|
|
||||||
|
$subject = $code['category_nm'];
|
||||||
|
|
||||||
|
if ($cd === "S10") {
|
||||||
|
$body = sprintf($code['cd_nm'], $data['rcpt_atclno'], $data['agent_nm'], $data['addr'], $data['rcpt_hscp_nm'], $data['rcpt_dtl_addr'], $data['rcpt_ho']);
|
||||||
|
} else {
|
||||||
|
$body = $code['cd_nm'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$body = str_replace('#매물번호#', $data['rcpt_atclno'], $code['cd_nm']);
|
||||||
|
|
||||||
|
$msg_length = strlen(iconv('UTF-8', 'EUCKR', $body));
|
||||||
|
if ($msg_length > 80 && $msg_type == 0) {
|
||||||
|
$msg_type = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
$param = [
|
||||||
|
//'cmid' => $cmid,
|
||||||
|
'dest_phone' => $dest_phone,
|
||||||
|
'dest_name' => $dest_name,
|
||||||
|
'send_phone' => $send_phone,
|
||||||
|
'send_name' => $send_name,
|
||||||
|
'subject' => $subject,
|
||||||
|
'msg_body' => $body,
|
||||||
|
'msg_type' => $msg_type,
|
||||||
|
'request_time' => $currDate,
|
||||||
|
'send_time' => $currDate,
|
||||||
|
'etc1' => $rsrv_sq,
|
||||||
|
'etc2' => $cd
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->db->transStart();
|
||||||
|
$this->db->table('ums_data')->insert($param);
|
||||||
|
$this->db->table('ums_log')->insert($param);
|
||||||
|
|
||||||
|
$remark = "문자 발송 - " . $subject . "(" . $dest_phone . ")";
|
||||||
|
$this->saveChangedHistory($rcpt_sq, $data['rcpt_stat'], 'C8', $usr_id, $remark);
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
if ($this->db->transStatus() === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장실패',
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function saveChangedHistory($rcpt_sq, $rcpt_stat, $changed_type, $usr_id, $remark)
|
public function saveChangedHistory($rcpt_sq, $rcpt_stat, $changed_type, $usr_id, $remark)
|
||||||
{
|
{
|
||||||
@@ -1303,4 +1609,104 @@ class ReceiptModel extends Model
|
|||||||
];
|
];
|
||||||
$res = $this->db->query($sql, $data);
|
$res = $this->db->query($sql, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 거주인정보저장
|
||||||
|
public function saveRecInfo($data)
|
||||||
|
{
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
$usr_sq = session('usr_sq');
|
||||||
|
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$detail = $this->getDetail($data['rcpt_key']);
|
||||||
|
|
||||||
|
!empty($data['file']) ? $rec_yn = "Y" : $rec_yn = "N";
|
||||||
|
|
||||||
|
$param = [
|
||||||
|
$rec_yn,
|
||||||
|
$data['rec_tel'],
|
||||||
|
$data['rec_nm'],
|
||||||
|
$data['rec_remark'],
|
||||||
|
$usr_sq,
|
||||||
|
$data['rsrv_sq'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$sql = "UPDATE result SET
|
||||||
|
rec_yn = ? ";
|
||||||
|
if ($rec_yn == "Y") {
|
||||||
|
$sql .= ", record_cplt_dt = NOW()";
|
||||||
|
}
|
||||||
|
$sql .= ", rec_tel = ?
|
||||||
|
, rec_nm = ?
|
||||||
|
, remark = ?
|
||||||
|
, update_tm = NOW()
|
||||||
|
, update_usr = ?
|
||||||
|
WHERE rsrv_sq = ?
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($this->db->query($sql, $param) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!empty($data['file'])) {
|
||||||
|
$rec_sql = "SELECT * FROM result_record WHERE rsrv_sq = ? AND use_yn = 'Y'";
|
||||||
|
$rec_data = array($data['rsrv_sq']);
|
||||||
|
$query = $this->db->query($rec_sql, $rec_data);
|
||||||
|
$preData = $query->getRowArray();
|
||||||
|
|
||||||
|
|
||||||
|
$f = $data['file'];
|
||||||
|
|
||||||
|
$sql = "INSERT INTO result_record
|
||||||
|
(rsrv_sq, use_yn, record_path, record_filenm, record_orignm, record_size, record_tel, record_nm, record_dt, remark, insert_usr, insert_tm, cloud_upload_yn)
|
||||||
|
VALUES
|
||||||
|
(?, 'Y', ?, ?, ?, ?, ?, ?, NOW(), ?, ?, NOW(), 'Y')
|
||||||
|
";
|
||||||
|
$param = [
|
||||||
|
$data['rsrv_sq'],
|
||||||
|
$f['file_path'],
|
||||||
|
$f['new_name'],
|
||||||
|
$f['orig_name'],
|
||||||
|
$f['size'],
|
||||||
|
$data['rec_tel'],
|
||||||
|
$data['rec_nm'],
|
||||||
|
$data['rec_remark'],
|
||||||
|
$usr_sq
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->db->query($sql, $param);
|
||||||
|
|
||||||
|
// 이전 데이터 미사용 처리
|
||||||
|
if (!empty($preData)) {
|
||||||
|
$rec_sql = "UPDATE result_record SET use_yn = 'N' WHERE record_sq = ? AND rsrv_sq = ?";
|
||||||
|
$this->db->query($rec_sql, [$preData['record_sq'], $data['rsrv_sq']]);
|
||||||
|
|
||||||
|
$remark = "녹취파일 업로드 - " . $preData['record_nm'] . "(" . $preData['record_tel'] . ") -> " . $data['rec_nm'] . "(" . $data['rec_tel'] . ")";
|
||||||
|
} else {
|
||||||
|
$remark = "녹취파일 업로드 - " . $data['rec_nm'] . "(" . $data['rec_tel'] . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->saveChangedHistory($data['rcpt_sq'], $detail['rcpt_stat'], 'C15', $usr_id, $remark);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($detail['rec_tel'])) {
|
||||||
|
$remark = "거주인정보변경 - " . $detail['rec_nm'] . "(" . $detail['rec_tel'] . ") -> " . $data['rec_nm'] . "(" . $data['rec_tel'] . ")";
|
||||||
|
} else {
|
||||||
|
$remark = "거주인정보변경 - " . $data['rec_nm'] . "(" . $data['rec_tel'] . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->saveChangedHistory($data['rcpt_sq'], $detail['rcpt_stat'], 'C15', $usr_id, $remark);
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -54,4 +54,18 @@ class CodeModel extends Model
|
|||||||
}
|
}
|
||||||
return $codes;
|
return $codes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 코드 상세
|
||||||
|
*/
|
||||||
|
public function getCodeDetail($category, $code)
|
||||||
|
{
|
||||||
|
$sql = "SELECT category, category_nm, cd, cd_nm FROM codes" .
|
||||||
|
" WHERE category = ? and cd = ?";
|
||||||
|
$data = [$category, $code];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getResultArray();
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -101,6 +101,15 @@
|
|||||||
// 3. 끝 슬래시 정리
|
// 3. 끝 슬래시 정리
|
||||||
$path = rtrim($path, '/');
|
$path = rtrim($path, '/');
|
||||||
switch ($path) {
|
switch ($path) {
|
||||||
|
case "/article/receipt/detail":
|
||||||
|
$path = "/article/receipt/lists";
|
||||||
|
break;
|
||||||
|
case "/article/dept/detail":
|
||||||
|
$path = "/article/dept/lists";
|
||||||
|
break;
|
||||||
|
case "/article/record/detail":
|
||||||
|
$path = "/article/record/lists";
|
||||||
|
break;
|
||||||
case "/board/notice/write":
|
case "/board/notice/write":
|
||||||
case "/board/notice/modify":
|
case "/board/notice/modify":
|
||||||
case "/board/notice/detail":
|
case "/board/notice/detail":
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -778,6 +778,27 @@ $usr_nm = session('usr_nm');
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 배정내역 excel
|
||||||
|
$("#excel-download2").on("click", function () {
|
||||||
|
$.ajax({
|
||||||
|
url: "/article/dept/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadExcel(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function initForm() {
|
function initForm() {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
public/plugin/img/video.png
Normal file
BIN
public/plugin/img/video.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Reference in New Issue
Block a user