vrfcReqModel 수정
This commit is contained in:
@@ -11,8 +11,8 @@ class StatusService
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->V2chgstatModel = model(V2chgstatModel::class);
|
||||
$this->V2chghistoryModel = model(V2chghistoryModel::class);
|
||||
// $this->V2chgstatModel = model(V2chgstatModel::class);
|
||||
// $this->V2chghistoryModel = model(V2chghistoryModel::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,22 +20,24 @@ class StatusService
|
||||
*/
|
||||
public function recordStatusAndHistory($vr_sq, $stat_cd, $chg_type, $memo)
|
||||
{
|
||||
$statModel = model(V2chgstatModel::class);
|
||||
$histModel = model(V2chghistoryModel::class);
|
||||
// 1. 상태(stat) 저장 (Insert or Update)
|
||||
try {
|
||||
$this->V2chgstatModel->saveChgstat([
|
||||
$statModel->saveChgstat([
|
||||
'vr_sq' => $vr_sq,
|
||||
'stat_cd' => $stat_cd,
|
||||
'insert_user' => '0',
|
||||
'insert_tm' => db_now()
|
||||
], 'I');
|
||||
} catch (\Exception $e) {
|
||||
$lastSql = (string)$this->V2chgstatModel->getLastQuery();
|
||||
$lastSql = (string)$statModel->getLastQuery();
|
||||
write_custom_log("STAT_SAVE_ERR | vr_sq: $vr_sq | SQL: $lastSql | Msg: " . $e->getMessage(), 'ERROR', 'failed');
|
||||
}
|
||||
|
||||
// 2. 이력(history) 저장
|
||||
try {
|
||||
$this->V2chghistoryModel->v2_savehistory([
|
||||
$histModel->v2_savehistory([
|
||||
'vr_sq' => $vr_sq,
|
||||
'stat_cd' => $stat_cd,
|
||||
'chg_type' => $chg_type,
|
||||
@@ -44,7 +46,7 @@ class StatusService
|
||||
'insert_tm' => db_now()
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
$lastSql = (string)$this->V2chghistoryModel->getLastQuery();
|
||||
$lastSql = (string)$histModel->getLastQuery();
|
||||
write_custom_log("HIST_SAVE_ERR | vr_sq: $vr_sq | SQL: $lastSql | Msg: " . $e->getMessage(), 'ERROR', 'failed');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user