From 9f20f4347a7fd7b4bbc3ae2c29d06b5250b8b3e1 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 4 Feb 2026 21:07:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Handlers/TypeV2Handler.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 테이블)