From a30cd4778c6559c1011149aa058c36080cefe6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0git=20config=20git=20config=20-?= =?UTF-8?q?-helpgit=20config=20--global=20user=2Ename=20=EC=B5=9C=EC=A4=80?= =?UTF-8?q?=ED=9D=A0?= Date: Thu, 22 Jun 2023 05:20:41 +0900 Subject: [PATCH] cfmgrv3 init...3 --- app/Controllers/Common/CommonController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Controllers/Common/CommonController.php b/app/Controllers/Common/CommonController.php index f0e3e84..0cd8847 100644 --- a/app/Controllers/Common/CommonController.php +++ b/app/Controllers/Common/CommonController.php @@ -197,10 +197,14 @@ class CommonController extends BaseController } protected function update_process($entity) { - if (!$this->_model->save($entity)) { - Log::add("error", __FUNCTION__ . "에서 호출:" . $this->_model->getLastQuery()); - Log::add("error", implode("\n", $this->_model->errors())); - throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->_model->errors(), true)); + if ($entity->hasChanged()) { + if (!$this->_model->save($entity)) { + Log::add("error", __FUNCTION__ . "에서 호출:" . $this->_model->getLastQuery()); + Log::add("error", implode("\n", $this->_model->errors())); + throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->_model->errors(), true)); + } + } else { + throw new \Exception("새로 변경된 값이 없습니다." . var_export($this->_viewDatas['fieldDatas'], true)); } return $entity; }