trafficmonitor init...2

This commit is contained in:
choi.jh 2025-11-12 16:49:08 +09:00
parent 2b1d4a4b0f
commit 4940171775

View File

@ -59,7 +59,7 @@ abstract class CommonService
{ {
try { try {
$entities = $this->getEntities_process($where, $columns); $entities = $this->getEntities_process($where, $columns);
// echo static::class . DIRECTORY_SEPARATOR . __FUNCTION__ . " Query:" . $this->model->getLastQuery(); log_message('debug', $this->model->getLastQuery());
return $entities; return $entities;
} catch (DatabaseException $e) { // 💡 DB 오류를 명시적으로 잡음 } catch (DatabaseException $e) { // 💡 DB 오류를 명시적으로 잡음
$errorMessage = sprintf( $errorMessage = sprintf(
@ -137,6 +137,7 @@ abstract class CommonService
//PrimaryKey 필드는 생성에서 제외 //PrimaryKey 필드는 생성에서 제외
unset($formDatas[$this->model->primaryKey]); unset($formDatas[$this->model->primaryKey]);
$result = $this->model->insert($formDatas, $this->model->useAutoIncrement()); $result = $this->model->insert($formDatas, $this->model->useAutoIncrement());
log_message('debug', $this->model->getLastQuery());
if ($result === false) { if ($result === false) {
$errors = $this->model->errors(); $errors = $this->model->errors();
$errorMsg = is_array($errors) ? implode(", ", $errors) : "삽입 작업이 실패했습니다."; $errorMsg = is_array($errors) ? implode(", ", $errors) : "삽입 작업이 실패했습니다.";
@ -168,12 +169,12 @@ abstract class CommonService
//PrimaryKey 필드는 수정에서 제외 //PrimaryKey 필드는 수정에서 제외
unset($formDatas[$this->model->primaryKey]); unset($formDatas[$this->model->primaryKey]);
$result = $this->model->update($uid, $formDatas); $result = $this->model->update($uid, $formDatas);
log_message('debug', $this->model->getLastQuery());
if ($result === false) { if ($result === false) {
$errors = $this->model->errors(); $errors = $this->model->errors();
$errorMsg = is_array($errors) ? implode(", ", $errors) : "업데이트 작업이 실패했습니다."; $errorMsg = is_array($errors) ? implode(", ", $errors) : "업데이트 작업이 실패했습니다.";
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg); throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg);
} }
log_message('debug', $this->model->getLastQuery());
return $this->handle_save_result($result, $uid); return $this->handle_save_result($result, $uid);
} }
public function modify($uid, object $dto): CommonEntity public function modify($uid, object $dto): CommonEntity
@ -200,6 +201,7 @@ abstract class CommonService
{ {
$entity = $this->delete_process($uid); $entity = $this->delete_process($uid);
$result = $this->model->delete($entity->getPK()); $result = $this->model->delete($entity->getPK());
log_message('debug', $this->model->getLastQuery());
if ($result === false) { if ($result === false) {
$errors = $this->model->errors(); $errors = $this->model->errors();
$errorMsg = is_array($errors) ? implode(", ", $errors) : "모델 삭제 작업이 실패했습니다."; $errorMsg = is_array($errors) ? implode(", ", $errors) : "모델 삭제 작업이 실패했습니다.";