worker 수정
This commit is contained in:
19
app/Models/Entities/NaverRawStagingModel.php
Normal file
19
app/Models/Entities/NaverRawStagingModel.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace App\Models\Entities;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class NaverRawStagingModel extends Model {
|
||||
protected $table = 'naver_raw_staging';
|
||||
protected $allowedFields = ['atcl_no', 'verification_type', 'request_type', 'raw_json'];
|
||||
|
||||
// 데이터를 넣기 전 자동으로 json_encode 실행
|
||||
protected $beforeInsert = ['encodeJson'];
|
||||
protected $beforeUpdate = ['encodeJson'];
|
||||
|
||||
protected function encodeJson(array $data) {
|
||||
if (isset($data['data']['raw_json']) && is_array($data['data']['raw_json'])) {
|
||||
$data['data']['raw_json'] = json_encode($data['data']['raw_json'], JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,16 @@ class ReceiptModel extends Model
|
||||
protected $table = 'receipt';
|
||||
protected $primaryKey = 'rcpt_sq';
|
||||
|
||||
// insert를 위해 이 줄을 추가해 주세요. (제공해주신 스키마 기반 주요 필드)
|
||||
protected $allowedFields = [
|
||||
'comp_sq', 'rcpt_rating', 'rcpt_key', 'rcpt_atclno', 'rcpt_type',
|
||||
'rcpt_product', 'rcpt_product_nm', 'rcpt_product_info1', 'rcpt_product_info2',
|
||||
'rcpt_product_info3', 'rcpt_office', 'rcpt_agent', 'rcpt_sido', 'rcpt_hscp_nm',
|
||||
'rcpt_dtl_addr', 'rcpt_etc_addr', 'rcpt_floor', 'rcpt_floor2', 'rcpt_tm',
|
||||
'rcpt_stat', 'rcpt_x', 'rcpt_y', 'agent_nm', 'agent_head_tel', 'rsrv_date',
|
||||
'insert_tm', 'rcpt_cpid', 'room_cnt', 'isSiteVRVerification'
|
||||
];
|
||||
|
||||
public function getReceiptList($params, $pageNum = 1, $pageSize = 20, $total = false)
|
||||
{
|
||||
$builder = $this->db->table('receipt a');
|
||||
|
||||
43
app/Models/Entities/ResultModel.php
Normal file
43
app/Models/Entities/ResultModel.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Entities;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ResultModel extends Model
|
||||
{
|
||||
protected $table = 'result';
|
||||
protected $primaryKey = 'rsrv_sq';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false; // 스키마에 삭제 플래그가 없으므로 false
|
||||
|
||||
// insert/update 시 허용할 컬럼 목록
|
||||
protected $allowedFields = [
|
||||
'rcpt_sq', 'use_yn', 'dept_sq', 'usr_sq', 'cust_nm',
|
||||
'cust_zip', 'cust_addr1', 'cust_addr2', 'cust_tel1', 'cust_tel2',
|
||||
'rsrv_date', 'rsrv_tm_ap', 'rsrv_tm_hour', 'rsrv_tm_min', 'remark',
|
||||
'req_rec_yn', 'rec_yn', 'rec_tel', 'rec_nm', 'result_cd1',
|
||||
'result_cd2', 'result_cd3', 'rsrv_save_dt', 'assign_save_dt',
|
||||
'photo_save_dt', 'result_save_dt', 'insert_tm', 'insert_usr',
|
||||
'update_tm', 'update_usr', 'result_msg', 'check_cplt_dt',
|
||||
'check_dt', 'record_cplt_dt', 'request_msg', 'rsrv_cplt_dt',
|
||||
'rsrv_delay_dt', 'cancel_dt', 'check_delay_dt', 'check_fail_dt',
|
||||
'resYn', 'dbUsageAgrYn', 'vr_check_cplt_dt'
|
||||
];
|
||||
|
||||
// 날짜 자동 설정 기능 (선택 사항)
|
||||
// 직접 로직에서 date('Y-m-d H:i:s')를 넣으신다면 false로 두셔도 됩니다.
|
||||
protected $useTimestamps = false;
|
||||
|
||||
/**
|
||||
* 특정 접수 번호로 결과 정보 조회 (Join 예시)
|
||||
*/
|
||||
public function getResultWithReceipt($rcpt_sq)
|
||||
{
|
||||
return $this->select('result.*, receipt.rcpt_atclno, receipt.rcpt_product_nm')
|
||||
->join('receipt', 'receipt.rcpt_sq = result.rcpt_sq')
|
||||
->where('result.rcpt_sq', $rcpt_sq)
|
||||
->first();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user