This commit is contained in:
@@ -111,6 +111,11 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
|||||||
$routes->post('m703a/getNextFaxImgs', 'M703::getNextFaxImgs'); // 다음매물정보조회
|
$routes->post('m703a/getNextFaxImgs', 'M703::getNextFaxImgs'); // 다음매물정보조회
|
||||||
$routes->post('m703a/saveRequestMessage', 'M703::saveRequestMessage'); // 중개사요청사항저장
|
$routes->post('m703a/saveRequestMessage', 'M703::saveRequestMessage'); // 중개사요청사항저장
|
||||||
$routes->post('m703a/saveResult', 'M703::saveResult'); // 결과저장
|
$routes->post('m703a/saveResult', 'M703::saveResult'); // 결과저장
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 홍보확인서 확인
|
||||||
|
*/
|
||||||
|
$routes->get('m703a/find', 'M703::find');
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -604,4 +604,19 @@ class M703 extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 홍보확인서 확인
|
||||||
|
public function find()
|
||||||
|
{
|
||||||
|
$fax = $this->model->getOneFax();
|
||||||
|
|
||||||
|
if (empty($fax)) {
|
||||||
|
return redirect()->back()
|
||||||
|
->with('alert', '새로운 FAX가 존재하지 않습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return redirect()->to('/m703/m703a/detail/' . $fax['fax_sq']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2182,4 +2182,56 @@ class M703Model extends Model
|
|||||||
];
|
];
|
||||||
$res = $this->db->query($sql, $data);
|
$res = $this->db->query($sql, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 홍보확인서 확인
|
||||||
|
public function getOneFax()
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
$usr_sq = session('usr_sq');
|
||||||
|
$h_y = $this->get_send_yn('H');
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
a.fax_sq, a.mid, a.file_name, a.file_path, a.thumbnail, a.img_width, a.img_height, a.img_size, a.img_sq, a.remark, a.work_type, a.atcl_no, a.cpid, a.realtor_nm, a.stat_cd, a.proc_tm, a.send_tm, a.address_code, a.address2, a.charger, a.reg_charger
|
||||||
|
FROM
|
||||||
|
fax_imgs a
|
||||||
|
WHERE
|
||||||
|
a.recv_time > DATE_ADD(NOW(), INTERVAL -7 DAY)
|
||||||
|
AND a.stat_cd = '10'
|
||||||
|
AND not exists ( SELECT 'x' from v2_vrfc_req v2 where a.vr_sq = v2.vr_sq AND v2.stat_cd = '40' )
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($h_y['stop_yn'] != 'N') {
|
||||||
|
$sql .= "AND a.recv_time < date_format(curdate( ), '%Y-%m-%d 17:30:00') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "AND a.fax_sq > '' ";
|
||||||
|
|
||||||
|
$sql .= "ORDER BY a.fax_sq ASC LIMIT 1 FOR UPDATE SKIP LOCKED ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
$row_dept = $this->getDepartmentPath($usr_sq);
|
||||||
|
$dept1_sq = '';
|
||||||
|
$dept2_sq = '';
|
||||||
|
if (!empty($row_dept)) {
|
||||||
|
$dept1_sq = $row_dept['dept1_sq'];
|
||||||
|
$dept2_sq = $row_dept['dept2_sq'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($row)) {
|
||||||
|
$sql = "UPDATE fax_imgs SET
|
||||||
|
stat_cd = '20', charger = '{$usr_id}', dept1_sq = '{$dept1_sq}', dept2_sq = '{$dept2_sq}'
|
||||||
|
WHERE fax_sq = {$row['fax_sq']}
|
||||||
|
";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user