fix:고객관리 필터 버튼 정리 (영업중/완료/인계완료)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-07 08:59:55 +09:00
parent 56e1fa33fe
commit d6cf587bc9
2 changed files with 18 additions and 21 deletions

View File

@@ -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(),
];
// 영업파트너별 통계