fix: [stats] QuoteStatService codebridge DB 커넥션 연결
- codebridge DB로 이관된 테이블(sales_prospect_consultations, sales_prospects) 커넥션을 mysql → codebridge로 변경 - config/database.php에 codebridge 커넥션 추가 - quote_daily 집계 실패 해결 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,14 +44,14 @@ public function aggregateDaily(int $tenantId, Carbon $date): int
|
||||
")
|
||||
->first();
|
||||
|
||||
// 상담 (sales_prospect_consultations)
|
||||
$consultationCount = DB::connection('mysql')
|
||||
// 상담 (sales_prospect_consultations) - codebridge DB로 이관됨
|
||||
$consultationCount = DB::connection('codebridge')
|
||||
->table('sales_prospect_consultations')
|
||||
->whereDate('created_at', $dateStr)
|
||||
->count();
|
||||
|
||||
// 영업 기회 (sales_prospects - tenant_id 없음, created_at 기반)
|
||||
$prospectStats = DB::connection('mysql')
|
||||
// 영업 기회 (sales_prospects) - codebridge DB로 이관됨
|
||||
$prospectStats = DB::connection('codebridge')
|
||||
->table('sales_prospects')
|
||||
->whereDate('created_at', $dateStr)
|
||||
->whereNull('deleted_at')
|
||||
@@ -74,7 +74,7 @@ public function aggregateDaily(int $tenantId, Carbon $date): int
|
||||
'prospect_created_count' => $prospectStats->created_count ?? 0,
|
||||
'prospect_won_count' => $prospectStats->won_count ?? 0,
|
||||
'prospect_lost_count' => $prospectStats->lost_count ?? 0,
|
||||
'prospect_amount' => 0, // sales_prospects에 금액 컬럼 없음
|
||||
'prospect_amount' => 0,
|
||||
'bidding_count' => $biddingStats->cnt ?? 0,
|
||||
'bidding_won_count' => $biddingStats->won_count ?? 0,
|
||||
'bidding_amount' => $biddingStats->total_amount ?? 0,
|
||||
|
||||
Reference in New Issue
Block a user