From e960e0c0e10148bffbdb477ec06c3d0d6635e48a Mon Sep 17 00:00:00 2001 From: pro Date: Wed, 28 Jan 2026 20:34:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=ED=85=8C=EB=84=8C=ED=8A=B8=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EC=8B=9C=20=EA=B3=A0=EC=9C=A0=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=9E=90=EB=8F=99=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - code 필드 추가 (T + 날짜 + 랜덤 4자리) - 예: T260128ABC1 Co-Authored-By: Claude Opus 4.5 --- app/Services/Sales/TenantProspectService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/Sales/TenantProspectService.php b/app/Services/Sales/TenantProspectService.php index c16d8e9e..a8d0aa2a 100644 --- a/app/Services/Sales/TenantProspectService.php +++ b/app/Services/Sales/TenantProspectService.php @@ -103,9 +103,13 @@ public function update( public function convertToTenant(TenantProspect $prospect, int $convertedBy): Tenant { return DB::transaction(function () use ($prospect, $convertedBy) { + // 고유 테넌트 코드 생성 (T + 타임스탬프 + 랜덤) + $tenantCode = 'T' . now()->format('ymd') . strtoupper(substr(uniqid(), -4)); + // 테넌트 생성 $tenant = Tenant::create([ 'company_name' => $prospect->company_name, + 'code' => $tenantCode, 'business_num' => $prospect->business_number, 'ceo_name' => $prospect->ceo_name, 'phone' => $prospect->contact_phone,