From 83af5ea473ecd75bef929adb26d3ac27d5e97b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 31 Jan 2026 19:24:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=98=81=EC=97=85=20=EB=8C=80=EC=8B=9C?= =?UTF-8?q?=EB=B3=B4=EB=93=9C=EC=97=90=20=EC=A7=84=ED=96=89=EC=A4=91=20?= =?UTF-8?q?=EA=B0=80=EB=A7=9D=EA=B3=A0=EA=B0=9D=20=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 고객 관리에서 등록한 가망고객(TenantProspect)도 내 계약 현황에 표시 - active/expired 상태의 가망고객을 '영업 진행중' 섹션으로 구분하여 표시 - 영업권 만료까지 D-day 표시 - 상세 버튼으로 고객 관리 페이지 연결 Co-Authored-By: Claude Opus 4.5 --- .../Sales/SalesDashboardController.php | 8 ++ .../dashboard/partials/tenant-list.blade.php | 83 +++++++++++++++++-- 2 files changed, 86 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Sales/SalesDashboardController.php b/app/Http/Controllers/Sales/SalesDashboardController.php index 36432edf..b00e74b9 100644 --- a/app/Http/Controllers/Sales/SalesDashboardController.php +++ b/app/Http/Controllers/Sales/SalesDashboardController.php @@ -158,9 +158,16 @@ private function getDashboardData(Request $request): array // 두 목록 합치기 (중복 제거) $convertedTenantIds = array_unique(array_merge($registeredTenantIds, $managedTenantIds)); + // 3) 내가 등록한 가망고객 (아직 전환되지 않은 것 - active 상태) + $prospects = TenantProspect::whereIn('registered_by', $partnerIds) + ->whereIn('status', [TenantProspect::STATUS_ACTIVE, TenantProspect::STATUS_EXPIRED]) + ->orderBy('created_at', 'desc') + ->get(); + // 수익 및 테넌트 관리 통계 (실제 데이터) $tenantStats = [ 'total_tenants' => count($convertedTenantIds), // 관리 테넌트 + 'total_prospects' => $prospects->count(), // 진행중 가망고객 'total_membership_revenue' => $totalMembershipFee, // 총 가입비 실적 'total_commission_accumulated' => $totalCommission, // 누적 수당 'confirmed_commission' => $paidCommission, // 확정(지급완료) 수당 @@ -190,6 +197,7 @@ private function getDashboardData(Request $request): array 'totalCommissionRatio', 'tenantStats', 'tenants', + 'prospects', 'managements', 'allManagers', 'period', diff --git a/resources/views/sales/dashboard/partials/tenant-list.blade.php b/resources/views/sales/dashboard/partials/tenant-list.blade.php index 3a82b5a3..94cce5b6 100644 --- a/resources/views/sales/dashboard/partials/tenant-list.blade.php +++ b/resources/views/sales/dashboard/partials/tenant-list.blade.php @@ -51,20 +51,93 @@

내 계약 현황

- 총 {{ $tenants->total() }}건 + 총 {{ $tenants->total() + (isset($prospects) ? $prospects->count() : 0) }}건 - @if($tenants->isEmpty()) + {{-- 가망고객 (아직 전환되지 않은 영업권) --}} + @if(isset($prospects) && $prospects->isNotEmpty()) +
+
+ 영업 진행중 + {{ $prospects->count() }}건 +
+
+ @foreach($prospects as $prospect) +
+ +
+
+
{{ $prospect->company_name }}
+ + {{ $prospect->status_label }} + +
+
+ @if($prospect->ceo_name) + 대표: {{ $prospect->ceo_name }} + | + @endif + {{ $prospect->business_number ?? '-' }} + @if($prospect->contact_phone) + | + {{ $prospect->contact_phone }} + @endif +
+
+ + +
+ @if($prospect->isActive()) +
영업권 만료까지
+
D-{{ $prospect->remaining_days }}
+ @elseif($prospect->isExpired()) +
상태
+
만료됨
+ @endif +
+ + +
+
등록일
+
{{ $prospect->registered_at?->format('Y-m-d') ?? $prospect->created_at->format('Y-m-d') }}
+
+ + + +
+ @endforeach +
+
+ @endif + + {{-- 계약 완료 고객 --}} + @if($tenants->isNotEmpty()) +
+ 계약 완료 + {{ $tenants->total() }}건 +
+ @endif + + @if($tenants->isEmpty() && (!isset($prospects) || $prospects->isEmpty()))
-

아직 계약이 없습니다

-

가망고객에서 전환된 계약이 여기에 표시됩니다

+

등록된 고객이 없습니다

+

고객 관리에서 명함을 등록하면 여기에 표시됩니다

- @else + @elseif($tenants->isNotEmpty()) {{-- 헤더 없는 깔끔한 리스트 스타일 --}}