Merge pull request '상세추가' (#21) from feature/template into master
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/21
This commit was merged in pull request #21.
This commit is contained in:
@@ -263,8 +263,8 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
|||||||
$routes->post('m712a/rotateImage', 'M712::rotateImage'); // 이미지 회전
|
$routes->post('m712a/rotateImage', 'M712::rotateImage'); // 이미지 회전
|
||||||
$routes->post('m712a/uploadFile', 'M712::uploadFile'); // 파일업로드
|
$routes->post('m712a/uploadFile', 'M712::uploadFile'); // 파일업로드
|
||||||
$routes->post('m712a/saveNotReceived', 'M712::saveNotReceived'); // 서류미수취 저장
|
$routes->post('m712a/saveNotReceived', 'M712::saveNotReceived'); // 서류미수취 저장
|
||||||
$routes->post('m712a/nextRegi', 'M712::saveRegi'); // 매물저장
|
$routes->post('m712a/saveRegi', 'M712::saveRegi'); // 매물저장
|
||||||
$routes->post('m712a/nextRegi', 'M712::nextRegi'); // 매물저장
|
$routes->post('m712a/nextRegi', 'M712::nextRegi'); // 다음매물
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -280,6 +280,10 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
|||||||
*/
|
*/
|
||||||
$routes->get('m713a/getResultList', 'M713::getResultList');
|
$routes->get('m713a/getResultList', 'M713::getResultList');
|
||||||
$routes->get('m713a/excel', 'M713::excel');
|
$routes->get('m713a/excel', 'M713::excel');
|
||||||
|
$routes->post('m713a/rotateImage', 'M713::rotateImage'); // 이미지 회전
|
||||||
|
$routes->post('m713a/saveCorpOwn', 'M713::saveCorpOwn'); // 법인매물저장
|
||||||
|
$routes->post('m713a/saveRegi', 'M713::saveRegi'); // 매물저장
|
||||||
|
$routes->post('m713a/nextRegi', 'M713::nextRegi'); // 다음매물
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ namespace App\Controllers\V2;
|
|||||||
|
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
use App\Libraries\Common;
|
use App\Libraries\Common;
|
||||||
|
use App\Libraries\MyUpload;
|
||||||
use App\Models\common\CodeModel;
|
use App\Models\common\CodeModel;
|
||||||
use App\Models\v2\M712Model;
|
use App\Models\v2\M712Model;
|
||||||
|
|
||||||
@@ -310,7 +311,7 @@ class M712 extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 다음매물확인
|
// 다음매물확인
|
||||||
public function getNextInfo()
|
public function nextRegi()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
namespace App\Controllers\V2;
|
namespace App\Controllers\V2;
|
||||||
|
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
|
use App\Libraries\MyUpload;
|
||||||
use App\Models\common\CodeModel;
|
use App\Models\common\CodeModel;
|
||||||
use App\Models\v2\M713Model;
|
use App\Models\v2\M713Model;
|
||||||
|
|
||||||
@@ -126,8 +127,200 @@ class M713 extends BaseController
|
|||||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$codes = $this->codeModel->getCodeLists(['VRFCREQ_WAY', 'CONFIRM_RESULT_D11', 'CONFIRM_RESULT_T11', 'TRADE_TYPE', 'CERT_UNCNFRM_STATUS']); // 코드조회
|
||||||
|
|
||||||
|
$data = $this->model->getDetail($id);
|
||||||
|
$memo = $this->model->getMemo($id);
|
||||||
|
|
||||||
|
$record = $this->model->getRecordInfo($id, '1'); //홍보확인서
|
||||||
|
$regist = $this->model->getRecordInfo($id, '2'); //등기부등본
|
||||||
|
$display = $this->model->getDisplay('M713_detail');
|
||||||
|
|
||||||
|
$sido = $this->model->getAreaList(); // 지역조회
|
||||||
|
|
||||||
|
$this->data['codes'] = $codes;
|
||||||
|
$this->data['data'] = $data;
|
||||||
|
$this->data['memo'] = $memo;
|
||||||
|
$this->data['record'] = $record;
|
||||||
|
$this->data['regist'] = $regist;
|
||||||
|
$this->data['display'] = $display;
|
||||||
|
$this->data['sido'] = $sido;
|
||||||
|
|
||||||
return view("pages/v2/m713/detail", $this->data);
|
return view("pages/v2/m713/detail", $this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 이미지회전
|
||||||
|
public function rotateImage()
|
||||||
|
{
|
||||||
|
$common = new Common();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$vr_sq = $this->request->getPost('vr_sq');
|
||||||
|
$degress = $this->request->getPost('degress');
|
||||||
|
|
||||||
|
if (empty($degrees) || !is_numeric($degrees)) {
|
||||||
|
$degrees = 90;
|
||||||
|
}
|
||||||
|
|
||||||
|
$regist = $this->model->getRecordInfo($vr_sq, '2');
|
||||||
|
$fullPath = $regist['file_path'] . $regist['file_name'];
|
||||||
|
$fullPath = $_SERVER['DOCUMENT_ROOT'] . $common->realpath_to_webpath($fullPath);
|
||||||
|
|
||||||
|
$degrees = (float) $degrees;
|
||||||
|
|
||||||
|
$im = new \Imagick($fullPath);
|
||||||
|
|
||||||
|
// 배경색(회전 시 빈 공간 채우는 색). 투명 원하면 'transparent'
|
||||||
|
$im->setImageBackgroundColor(new \ImagickPixel('white'));
|
||||||
|
|
||||||
|
// 회전
|
||||||
|
$im->rotateImage($im->getImageBackgroundColor(), $degrees);
|
||||||
|
|
||||||
|
// 포맷/압축 유지(옵션)
|
||||||
|
$im->setImageCompressionQuality(90);
|
||||||
|
|
||||||
|
// 덮어쓰기
|
||||||
|
$im->writeImage($fullPath);
|
||||||
|
|
||||||
|
$im->clear();
|
||||||
|
$im->destroy();
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success',
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 법인매물저장
|
||||||
|
public function saveCorpOwn()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$vr_sq = $this->request->getPost('vr_sq');
|
||||||
|
$atcl_no = $this->request->getPost('atcl_no');
|
||||||
|
|
||||||
|
// UPDATE v2_article_info_etc
|
||||||
|
$this->model->saveCorpOwn($vr_sq, $atcl_no);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success',
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 파일업로드
|
||||||
|
public function uploadFile()
|
||||||
|
{
|
||||||
|
$lib = new MyUpload();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
$vr_sq = $this->request->getPost('vr_sq');
|
||||||
|
|
||||||
|
$file = $this->request->getFile('file');
|
||||||
|
|
||||||
|
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||||
|
|
||||||
|
$uploadPath = "/upload/v2_file/" . $vr_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 = [
|
||||||
|
'vr_sq' => $vr_sq,
|
||||||
|
// 'file_sq' => $this->request->getPost('file_sq'),
|
||||||
|
'orig_name' => $uploadFile['origin_name'],
|
||||||
|
'new_name' => $uploadFile['file_name'],
|
||||||
|
'file_path' => $uploadPath, // 필요에 따라 상대경로로만 저장
|
||||||
|
'ext' => '.' . $uploadFile['ext'],
|
||||||
|
'size' => $file->getSize(),
|
||||||
|
'img_yn' => null,
|
||||||
|
'img_height' => null,
|
||||||
|
'img_width' => null,
|
||||||
|
'usr_id' => $usr_id,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data)) {
|
||||||
|
|
||||||
|
// 파일업로드 정보 저장
|
||||||
|
$this->model->saveFileInfo($data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 다음매물확인
|
||||||
|
public function nextRegi()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$vr_sq = $this->request->getPost('vr_sq');
|
||||||
|
|
||||||
|
$data = $this->model->getNextInfo($vr_sq);
|
||||||
|
|
||||||
|
if (empty($data)) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => '등기부등본 이미지가 존재하지 않습니다.'
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success',
|
||||||
|
'resw' => $data['vr_sq']
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -621,4 +621,332 @@ class M713Model extends Model
|
|||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 상세화면
|
||||||
|
public function getDetail($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.vr_sq,
|
||||||
|
a.dong_ho_chk,
|
||||||
|
a.reg_status,
|
||||||
|
a.hscplqry_lv,
|
||||||
|
a.atcl_no,
|
||||||
|
b.stat_cd,
|
||||||
|
a.cpid,
|
||||||
|
a.cp_atcl_id,
|
||||||
|
a.rlet_type_cd,
|
||||||
|
a.address1,
|
||||||
|
a.sise,
|
||||||
|
a.rdate,
|
||||||
|
a.hscp_no as chk_hscp_no,
|
||||||
|
b.try_cnt,
|
||||||
|
a.seller_tel_no,
|
||||||
|
a.seller_nm,
|
||||||
|
a.realtor_nm,
|
||||||
|
a.realtor_tel_no,
|
||||||
|
a.charger,
|
||||||
|
a.ownerNm,
|
||||||
|
a.ownerTelNo,
|
||||||
|
b.reg_try_cnt,
|
||||||
|
b.insert_tm,
|
||||||
|
a.reg_charger,
|
||||||
|
i2.usr_nm as reg_charger_nm,
|
||||||
|
c.bild_nm,
|
||||||
|
b.vrfc_type as vrfc_type_cd,
|
||||||
|
c.rm_no,
|
||||||
|
c.floor,
|
||||||
|
c.floor2,
|
||||||
|
c.address_code,
|
||||||
|
c.address2,
|
||||||
|
c1.address2a,
|
||||||
|
c1.address2b,
|
||||||
|
c.address3,
|
||||||
|
c.address4,
|
||||||
|
c.trade_type as trade_type_cd,
|
||||||
|
c.deal_amt,
|
||||||
|
c.wrrnt_amt,
|
||||||
|
c.lease_amt,
|
||||||
|
c.isale_amt,
|
||||||
|
c.prem_amt,
|
||||||
|
c.sply_spc,
|
||||||
|
c.excls_spc,
|
||||||
|
c.tot_spc,
|
||||||
|
c.grnd_spc,
|
||||||
|
c.bldg_spc,
|
||||||
|
c.hscp_no,
|
||||||
|
c.ptp_no,
|
||||||
|
d.insert_tm as update_res_tm,
|
||||||
|
e.insert_tm as result_tm,
|
||||||
|
f.region_nm,
|
||||||
|
g.cd_nm as pre_stat,
|
||||||
|
g.cd as pre_stat_cd,
|
||||||
|
h.cd_nm as vrfc_type,
|
||||||
|
i.usr_nm,
|
||||||
|
j.cd_nm as trade_type,
|
||||||
|
j.cd as trade_type_cd,
|
||||||
|
c.hscp_nm,
|
||||||
|
c.ptp_nm,
|
||||||
|
l.success,
|
||||||
|
k.cd_nm as atcl_nm,
|
||||||
|
m.code as result_d11,
|
||||||
|
m.comment,
|
||||||
|
n.code as fax_conf_yn_2,
|
||||||
|
o.code as fax_conf_yn_3,
|
||||||
|
p.code as fax_conf_yn_4,
|
||||||
|
n.comment as fax_conf_yn_info_2,
|
||||||
|
o.comment as fax_conf_yn_info_3,
|
||||||
|
p.comment as fax_conf_yn_info_4,
|
||||||
|
v.success AS tel_suc,
|
||||||
|
r.code AS tel_agree,
|
||||||
|
s.code AS tel_conf_yn_2,
|
||||||
|
t.code AS tel_conf_yn_3,
|
||||||
|
u.code AS tel_conf_yn_4,
|
||||||
|
s.comment AS tel_conf_yn_info_2,
|
||||||
|
t.comment AS tel_conf_yn_info_3,
|
||||||
|
u.comment AS tel_conf_yn_info_4,
|
||||||
|
w.success AS reg_conf_yn_1,
|
||||||
|
x.code AS reg_conf_yn_2,
|
||||||
|
y.code AS reg_conf_yn_3,
|
||||||
|
x.comment AS reg_conf_yn_info_2,
|
||||||
|
y.comment AS reg_conf_yn_info_3,
|
||||||
|
b.rgbk_confirm,
|
||||||
|
a.redvlp_area_nm,
|
||||||
|
a.biz_stp_desc,
|
||||||
|
a.cert_register,
|
||||||
|
a.confirm_doc_img_url,
|
||||||
|
a.cert_register_save_yn,
|
||||||
|
a.confirm_doc_img_url_save_yn,
|
||||||
|
b.confirm_doc_owner_check_yn,
|
||||||
|
a.owner_birth,
|
||||||
|
a.vrfc_type_sub,
|
||||||
|
b.owner_verifiable,
|
||||||
|
a.reference_file_url,
|
||||||
|
a.reference_file_url_save_yn,
|
||||||
|
a.reference_file_url_yn,
|
||||||
|
z.corp_own,
|
||||||
|
c1.vir_addr_yn,
|
||||||
|
c1.cert_uncnfrm_status,
|
||||||
|
c1.noRgbkVrfcReqYn,
|
||||||
|
c1.areaByBdbkVrfcReqYn,
|
||||||
|
sm.sm_apporval_date ,
|
||||||
|
sm.sm_end_date,
|
||||||
|
sm.sm_seq,
|
||||||
|
a.registerBookUniqueNumber
|
||||||
|
FROM v2_article_info a
|
||||||
|
JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
|
||||||
|
JOIN v2_article_info_etc c1 ON c1.vr_sq = a.vr_sq
|
||||||
|
LEFT JOIN region_codes f ON a.address_code = f.region_cd
|
||||||
|
LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = '35'
|
||||||
|
LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = '60'
|
||||||
|
LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
|
||||||
|
LEFT JOIN codes j ON c.trade_type = j.cd AND j.category = 'TRADE_TYPE'
|
||||||
|
LEFT JOIN codes k ON a.rlet_type_cd = k.cd AND k.category = 'ARTICLE_TYPE'
|
||||||
|
LEFT JOIN v2_confirm l ON a.vr_sq = l.vr_sq AND l.vrfc_type = 'D'
|
||||||
|
LEFT JOIN v2_check_list m ON a.vr_sq = m.vr_sq AND m.type = 'D11'
|
||||||
|
LEFT JOIN v2_check_list n ON a.vr_sq = n.vr_sq AND n.type = 'D12'
|
||||||
|
LEFT JOIN v2_check_list o ON a.vr_sq = o.vr_sq AND o.type = 'D13'
|
||||||
|
LEFT JOIN v2_check_list p ON a.vr_sq = p.vr_sq AND p.type = 'D14'
|
||||||
|
LEFT JOIN v2_confirm v ON a.vr_sq = v.vr_sq AND v.vrfc_type = 'T'
|
||||||
|
LEFT JOIN v2_check_list r ON a.vr_sq = r.vr_sq AND r.type = 'T11'
|
||||||
|
LEFT JOIN v2_check_list s ON a.vr_sq = s.vr_sq AND s.type = 'T12'
|
||||||
|
LEFT JOIN v2_check_list t ON a.vr_sq = t.vr_sq AND t.type = 'T13'
|
||||||
|
LEFT JOIN v2_check_list u ON a.vr_sq = u.vr_sq AND u.type = 'T14'
|
||||||
|
LEFT JOIN v2_confirm w ON a.vr_sq = w.vr_sq AND w.vrfc_type = 'R'
|
||||||
|
LEFT JOIN v2_check_list x ON a.vr_sq = x.vr_sq AND x.type = '21'
|
||||||
|
LEFT JOIN v2_check_list y ON a.vr_sq = y.vr_sq AND y.type = '22'
|
||||||
|
LEFT JOIN users i ON a.charger = i.usr_id
|
||||||
|
LEFT JOIN users i2 ON a.reg_charger = i2.usr_id
|
||||||
|
LEFT JOIN v2_article_info_etc z ON a.vr_sq = z.vr_sq
|
||||||
|
LEFT JOIN scomplex_manage sm ON a.hscp_no = sm.sm_code
|
||||||
|
|
||||||
|
WHERE
|
||||||
|
a.vr_sq = ?";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 메모
|
||||||
|
public function getMemo($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT memo FROM v2_vrfc_req where vr_sq = ?";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRecordInfo($vr_sq, $file_type)
|
||||||
|
{
|
||||||
|
$sql = "SELECT seq, vr_sq, use_yn, file_type, view_odr, file_path, file_name, file_ext, file_size, img_width, img_height, meta_data, insert_user, insert_tm , cloud_upload_yn " .
|
||||||
|
" FROM v2_files" .
|
||||||
|
" WHERE vr_sq = ?" .
|
||||||
|
" AND use_yn = 'Y'" .
|
||||||
|
" AND file_type = ?" .
|
||||||
|
" ORDER BY seq DESC";
|
||||||
|
$data = [
|
||||||
|
$vr_sq,
|
||||||
|
$file_type
|
||||||
|
];
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq, $file_type]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDisplay($menu_position)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = "SELECT display_yn " .
|
||||||
|
"FROM page_display " .
|
||||||
|
"WHERE menu_position = ? ";
|
||||||
|
$data = [$menu_position];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 법인매물저장
|
||||||
|
public function saveCorpOwn($vr_sq, $atcl_no)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_article_info_etc
|
||||||
|
(vr_sq, atcl_no, corp_own)
|
||||||
|
VALUES
|
||||||
|
(?, ?, 'Y')
|
||||||
|
ON DUPLICATE KEY UPDATE corp_own = 'Y'
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($this->db->query($sql, [$vr_sq, $atcl_no]) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 파일업로드
|
||||||
|
public function saveFileInfo($data)
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
// 기존파일 확인후 업데이트
|
||||||
|
$sql = "SELECT seq FROM v2_files WHERE vr_sq = {$data['vr_sq']} AND use_yn = 'Y' AND file_type = '2'";
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
$row = $query->getNumRows();
|
||||||
|
|
||||||
|
if ($row > 0) {
|
||||||
|
|
||||||
|
$sql = "UPDATE v2_files SET use_yn = 'N' WHERE vr_sq = {$data['vr_sq']} AND use_yn = 'Y' AND file_type '2'";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO v2_files
|
||||||
|
(vr_sq, file_type, view_odr, file_path, file_name, file_ext, file_size, insert_user, insert_tm, cloud_upload_yn)
|
||||||
|
VALUES
|
||||||
|
(?, '2', 0, ?, ?, ?, ?, ?, NOW(), 'Y')
|
||||||
|
";
|
||||||
|
|
||||||
|
$param = [
|
||||||
|
$data['vr_sq'],
|
||||||
|
$data['file_path'],
|
||||||
|
$data['new_name'],
|
||||||
|
$data['ext'],
|
||||||
|
$data['size'],
|
||||||
|
$data['usr_id'],
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->db->query($sql, $param)) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '파일정보 저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$row = $this->getDetail($data['vr_sq']);
|
||||||
|
$this->saveChangedHistory($data['vr_sq'], $row['stat_cd'], 'C28', $usr_id, '이미지파일 업로드');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 다음매물
|
||||||
|
public function getNextInfo($vr_sq)
|
||||||
|
{
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
$sql = "SELECT b.vr_sq
|
||||||
|
FROM v2_article_info b
|
||||||
|
INNER JOIN v2_vrfc_req a ON a.vr_sq = b.vr_sq AND a.vr_sq != ? AND a.stat_cd BETWEEN '35' AND '49' AND a.stat_cd NOT IN ('39','45')
|
||||||
|
LEFT JOIN v2_chg_stat c ON c.vr_sq = b.vr_sq AND c.stat_cd = '40'
|
||||||
|
WHERE a.insert_tm < DATE_FORMAT(curdate(), '%Y%m%d172959')
|
||||||
|
AND (b.reg_charger IS NULL OR b.reg_charger = '')
|
||||||
|
AND a.vrfc_type = 'N'
|
||||||
|
ORDER BY CASE a.vrfc_type WHEN 'N' THEN 1 ELSE 2 END, a.vr_sq
|
||||||
|
LIMIT 1
|
||||||
|
for update skip locked ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
if (!empty($row)) {
|
||||||
|
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$sql = "UPDATE v2_article_info SET reg_charger = ? WHERE vr_sq = ?";
|
||||||
|
|
||||||
|
if ($this->db->query($sql, [$usr_id, $vr_sq]) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 정보변경 이력 저장
|
||||||
|
public function saveChangedHistory($vr_sq, $stat_cd, $chg_type, $usr_id, $memo)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_chg_history" .
|
||||||
|
" (vr_sq, stat_cd, chg_type, insert_id, insert_tm, memo)" .
|
||||||
|
" VALUES" .
|
||||||
|
" (?, ?, ?, ?, now(), ?)";
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
$vr_sq,
|
||||||
|
$stat_cd,
|
||||||
|
$chg_type,
|
||||||
|
$usr_id,
|
||||||
|
$memo
|
||||||
|
];
|
||||||
|
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -936,6 +936,7 @@ function parseurl($url)
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 기타정보 -->
|
||||||
<div class="main-card mb-3 card">
|
<div class="main-card mb-3 card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="fw-semibold">기타 정보</span>
|
<span class="fw-semibold">기타 정보</span>
|
||||||
@@ -1242,7 +1243,7 @@ function parseurl($url)
|
|||||||
* 파일 Dropzone
|
* 파일 Dropzone
|
||||||
* */
|
* */
|
||||||
const dz = new Dropzone("#myDropzone", {
|
const dz = new Dropzone("#myDropzone", {
|
||||||
url: "/m705/m705a/uploadFile",
|
url: "/m712/m712a/uploadFile",
|
||||||
method: "post",
|
method: "post",
|
||||||
paramName: "files",
|
paramName: "files",
|
||||||
autoProcessQueue: false, // 자동 업로드 끄기
|
autoProcessQueue: false, // 자동 업로드 끄기
|
||||||
@@ -1509,7 +1510,7 @@ function parseurl($url)
|
|||||||
};
|
};
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/m705/m705a/getNextInfo',
|
url: '/m712/m712a/nextRegi',
|
||||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user