From cfc577fc2c2d6799c42dbc513ca70d606ebd11e0 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:06:13 +0900 Subject: [PATCH] cfmgrv3 init...3 --- app/Controllers/Common/CommonController.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/Controllers/Common/CommonController.php b/app/Controllers/Common/CommonController.php index 3947d35..b63ecce 100644 --- a/app/Controllers/Common/CommonController.php +++ b/app/Controllers/Common/CommonController.php @@ -173,7 +173,6 @@ class CommonController extends BaseController protected function update_validate($entity) { //변경된 값 적용 - $fieldDatas = array(); foreach ($this->_viewDatas['fields'] as $field) { $logs = array(); $value = rtrim($this->request->getVar($field)); @@ -181,10 +180,9 @@ class CommonController extends BaseController $log = "{$entity->getTitle()}의 {$field} : {$entity->$field}=>{$value}"; Log::add("info", $log); array_push($logs, $log); - $entity->$field = $fieldDatas[$field] = $value; + $entity->$field = $this->_viewDatas['fieldDatas'][$field] = $value; } } - $this->_viewDatas['fieldDatas'] = $fieldDatas; if (!$entity->hasChanged()) { throw new \Exception("새로 변경된 값이 없습니다." . var_export($logs, true)); } @@ -217,7 +215,6 @@ class CommonController extends BaseController } catch (\Exception $e) { $message = "{$entity->getTitle()} " . __FUNCTION__ . " 실패하였습니다."; Log::add("warning", $e->getMessage()); - Log::add("warning", var_export($this->_viewDatas['fieldDatas'], true)); Log::save("{$this->_viewDatas['title']} {$message}", false); return redirect()->back()->withInput()->with("error", $message . "
\n{$e->getMessage()}"); } @@ -251,7 +248,6 @@ class CommonController extends BaseController } catch (\Exception $e) { $message = "{$entity->getTitle()} " . __FUNCTION__ . " 실패하였습니다."; Log::add("warning", $e->getMessage()); - // Log::add("warning", var_export($this->_viewDatas['fieldDatas'], true)); Log::save("{$this->_viewDatas['title']} {$message}", false); return alert_CommonHelper($message . "
\n{$e->getMessage()}", 'back'); } @@ -267,7 +263,7 @@ class CommonController extends BaseController } } if (!is_array($fields) || count($fields) === 0) { - throw new \Exception($this->_viewDatas['title'] . '가 field가 정의되지 않았습니다.'); + throw new \Exception($this->_viewDatas['title'] . '에서 변경할 항목(field)이 선택되지 않았습니다.'); } //Fields,FielRules재정의 $this->_viewDatas['fields'] = $fields; @@ -288,7 +284,7 @@ class CommonController extends BaseController try { $uids = $this->request->getVar('batchjob_uids'); if (!is_array($uids) || count($uids) === 0) { - throw new \Exception($this->_viewDatas['title'] . '가 uid가 선택되지 않았습니다.'); + throw new \Exception($this->_viewDatas['title'] . '에서 변경할 항목(uid)이 선택되지 않았습니다.'); } $this->batchjob_init(); foreach ($uids as $uid) { @@ -302,7 +298,6 @@ class CommonController extends BaseController } catch (\Exception $e) { $message = "총: " . count($uids) . "개의 수정(Batchjob)을 실패하였습니다."; Log::add("warning", $e->getMessage()); - // Log::add("warning", var_export($this->_viewDatas['fieldDatas'], true)); Log::save("{$this->_viewDatas['title']} {$message}", false); return alert_CommonHelper($message . "
\n{$e->getMessage()}", 'back'); }