diff --git a/app/Services/Handlers/TypeV2Handler.php b/app/Services/Handlers/TypeV2Handler.php index 2bb093f..c141b3e 100644 --- a/app/Services/Handlers/TypeV2Handler.php +++ b/app/Services/Handlers/TypeV2Handler.php @@ -101,15 +101,21 @@ class TypeV2Handler // 수정 정보 입력 (있으면 update, 없으면 insert) // if (!$this->modifyInfoModel->saveModifyInfo($vrSq, $modifyInfoParam)) { $modifyInfoParam['vr_sq'] = $vrSq; - if (!$this->modifyInfoModel->replace($modifyInfoParam)) { - foreach ( $modifyInfoParam as $key => $value ) { - if (is_array($value)) { - CLI::write(CLI::color(" $key : " . json_encode($value, JSON_UNESCAPED_UNICODE) , 'red')); - } - } - CLI::write(CLI::color('❌ ModifyInfo 저장 실패 :: ' . json_encode($modifyInfoParam , JSON_UNESCAPED_UNICODE), 'red')); - throw new Exception("ModifyInfo 저장 실패: " . json_encode($this->db->error() . "sql: " . $this->modifyInfoModel->getLastQuery())); + + try { + $sql = $this->modifyInfoModel->builder() + ->set($modifyInfoParam) + ->getCompiledInsert(); // Insert/Replace 문을 문자열로 컴파일만 함 + CLI::write(CLI::color("\n[Generated SQL]: ", 'cyan') . $sql); + } catch (\Exception $e) { + // 아마 여기서 'Array to string conversion' 에러가 잡힐 겁니다. + CLI::write(CLI::color("\n[Error during SQL generation]: ", 'red') . $e->getMessage()); } + // if (!$this->modifyInfoModel->replace($modifyInfoParam)) { + + // CLI::write(CLI::color('❌ ModifyInfo 저장 실패 :: ' . json_encode($modifyInfoParam , JSON_UNESCAPED_UNICODE), 'red')); + // throw new Exception("ModifyInfo 저장 실패: " . json_encode($this->db->error() . "sql: " . $this->modifyInfoModel->getLastQuery())); + // } CLI::write(CLI::color('✅ ModifyInfo 저장 성공', 'blue')); // URL 이미지 저장 (v2_url_img_save 테이블)