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'); }