fix:고객관리 필터 버튼 정리 (영업중/완료/인계완료)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -108,12 +108,19 @@ private function getIndexData(Request $request): array
|
||||
});
|
||||
}
|
||||
|
||||
// 상태 필터 (progress_complete는 계산값 기반이므로 별도 처리)
|
||||
// 상태 필터
|
||||
$isProgressCompleteFilter = ($filters['status'] === 'progress_complete');
|
||||
if (!empty($filters['status']) && !$isProgressCompleteFilter) {
|
||||
$isHandoverFilter = ($filters['status'] === 'handover');
|
||||
if (!empty($filters['status']) && !$isProgressCompleteFilter && !$isHandoverFilter) {
|
||||
$query->where('status', $filters['status']);
|
||||
}
|
||||
|
||||
// 인계완료 필터: hq_status가 handover인 prospect만
|
||||
if ($isHandoverFilter) {
|
||||
$handoverProspectIds = SalesTenantManagement::where('hq_status', 'handover')->pluck('tenant_prospect_id');
|
||||
$query->whereIn('id', $handoverProspectIds);
|
||||
}
|
||||
|
||||
// 영업파트너 필터
|
||||
if (!empty($filters['registered_by'])) {
|
||||
$query->where('registered_by', $filters['registered_by']);
|
||||
@@ -207,10 +214,8 @@ private function getIndexData(Request $request): array
|
||||
$stats = [
|
||||
'total' => TenantProspect::count(),
|
||||
'active' => TenantProspect::where('status', TenantProspect::STATUS_ACTIVE)->count(),
|
||||
'expired' => TenantProspect::where('status', TenantProspect::STATUS_EXPIRED)->count(),
|
||||
'converted' => TenantProspect::where('status', TenantProspect::STATUS_CONVERTED)->count(),
|
||||
'completed' => TenantProspect::where('status', TenantProspect::STATUS_COMPLETED)->count(),
|
||||
'progress_complete' => $progressCompleteCount,
|
||||
'handover' => SalesTenantManagement::where('hq_status', 'handover')->count(),
|
||||
];
|
||||
|
||||
// 영업파트너별 통계
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
{{-- 통계 카드 --}}
|
||||
<div class="grid grid-cols-2 md:grid-cols-5 gap-4 mb-4">
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-4">
|
||||
<div class="bg-white rounded-lg shadow-sm p-4">
|
||||
<div class="text-sm text-gray-500">전체 고객</div>
|
||||
<div class="text-2xl font-bold text-gray-800">{{ number_format($stats['total']) }}건</div>
|
||||
</div>
|
||||
<div class="bg-blue-50 rounded-lg shadow-sm p-4">
|
||||
<div class="text-sm text-blue-600">영업 진행중</div>
|
||||
<div class="text-sm text-blue-600">영업중</div>
|
||||
<div class="text-2xl font-bold text-blue-800">{{ number_format($stats['active']) }}건</div>
|
||||
</div>
|
||||
<div class="bg-orange-50 rounded-lg shadow-sm p-4">
|
||||
<div class="text-sm text-orange-600">영업권 만료</div>
|
||||
<div class="text-2xl font-bold text-orange-800">{{ number_format($stats['expired']) }}건</div>
|
||||
</div>
|
||||
<div class="bg-teal-50 rounded-lg shadow-sm p-4">
|
||||
<div class="text-sm text-teal-600">완료</div>
|
||||
<div class="text-2xl font-bold text-teal-800">{{ number_format($stats['completed']) }}건</div>
|
||||
</div>
|
||||
<div class="bg-emerald-50 rounded-lg shadow-sm p-4">
|
||||
<div class="text-sm text-emerald-600">계약 완료</div>
|
||||
<div class="text-2xl font-bold text-emerald-800">{{ number_format($stats['converted']) }}건</div>
|
||||
<div class="text-sm text-emerald-600">인계완료</div>
|
||||
<div class="text-2xl font-bold text-emerald-800">{{ number_format($stats['handover']) }}건</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,19 +29,15 @@ class="px-3 py-2 rounded-lg text-sm font-medium transition {{ !request('status')
|
||||
</a>
|
||||
<a href="{{ route('sales.admin-prospects.index', array_merge(request()->except('page'), ['status' => 'active'])) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium transition {{ request('status') === 'active' ? 'bg-blue-600 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200' }}">
|
||||
진행중
|
||||
</a>
|
||||
<a href="{{ route('sales.admin-prospects.index', array_merge(request()->except('page'), ['status' => 'progress_complete'])) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium transition {{ request('status') === 'progress_complete' ? 'bg-purple-600 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200' }}">
|
||||
진행완료
|
||||
영업중
|
||||
</a>
|
||||
<a href="{{ route('sales.admin-prospects.index', array_merge(request()->except('page'), ['status' => 'completed'])) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium transition {{ request('status') === 'completed' ? 'bg-teal-600 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200' }}">
|
||||
완료
|
||||
</a>
|
||||
<a href="{{ route('sales.admin-prospects.index', array_merge(request()->except('page'), ['status' => 'converted'])) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium transition {{ request('status') === 'converted' ? 'bg-emerald-600 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200' }}">
|
||||
계약완료
|
||||
<a href="{{ route('sales.admin-prospects.index', array_merge(request()->except('page'), ['status' => 'handover'])) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium transition {{ request('status') === 'handover' ? 'bg-emerald-600 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200' }}">
|
||||
인계완료
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user