diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index e4be18c..1d906bc 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -59,7 +59,7 @@ abstract class CommonService { try { $entities = $this->getEntities_process($where, $columns); - // echo static::class . DIRECTORY_SEPARATOR . __FUNCTION__ . " Query:" . $this->model->getLastQuery(); + log_message('debug', $this->model->getLastQuery()); return $entities; } catch (DatabaseException $e) { // πŸ’‘ DB 였λ₯˜λ₯Ό λͺ…μ‹œμ μœΌλ‘œ 작음 $errorMessage = sprintf( @@ -137,6 +137,7 @@ abstract class CommonService //PrimaryKey ν•„λ“œλŠ” μƒμ„±μ—μ„œ μ œμ™Έ unset($formDatas[$this->model->primaryKey]); $result = $this->model->insert($formDatas, $this->model->useAutoIncrement()); + log_message('debug', $this->model->getLastQuery()); if ($result === false) { $errors = $this->model->errors(); $errorMsg = is_array($errors) ? implode(", ", $errors) : "μ‚½μž… μž‘μ—…μ΄ μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€."; @@ -168,12 +169,12 @@ abstract class CommonService //PrimaryKey ν•„λ“œλŠ” μˆ˜μ •μ—μ„œ μ œμ™Έ unset($formDatas[$this->model->primaryKey]); $result = $this->model->update($uid, $formDatas); + log_message('debug', $this->model->getLastQuery()); if ($result === false) { $errors = $this->model->errors(); $errorMsg = is_array($errors) ? implode(", ", $errors) : "μ—…λ°μ΄νŠΈ μž‘μ—…μ΄ μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€."; throw new RuntimeException(__METHOD__ . "μ—μ„œ 였λ₯˜λ°œμƒ: " . $errorMsg); } - log_message('debug', $this->model->getLastQuery()); return $this->handle_save_result($result, $uid); } public function modify($uid, object $dto): CommonEntity @@ -200,6 +201,7 @@ abstract class CommonService { $entity = $this->delete_process($uid); $result = $this->model->delete($entity->getPK()); + log_message('debug', $this->model->getLastQuery()); if ($result === false) { $errors = $this->model->errors(); $errorMsg = is_array($errors) ? implode(", ", $errors) : "λͺ¨λΈ μ‚­μ œ μž‘μ—…μ΄ μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.";