fix: EntertainmentService order_date → received_at 컬럼 수정

This commit is contained in:
2026-01-21 10:39:54 +09:00
parent b6de7fc722
commit ef6b1330fc

View File

@@ -121,13 +121,15 @@ public function getSummary(
*/
private function getAnnualSales(int $tenantId, string $startDate, string $endDate): float
{
// TODO: 실제 매출 테이블에서 조회
// 현재는 임시로 고정값 반환 (orders 테이블 또는 invoices 테이블에서 합계)
return DB::table('orders')
// orders 테이블에서 확정된 수주 합계 조회
$amount = DB::table('orders')
->where('tenant_id', $tenantId)
->whereBetween('order_date', [$startDate, $endDate])
->where('status_code', 'confirmed')
->whereBetween('received_at', [$startDate, $endDate])
->whereNull('deleted_at')
->sum('total_amount') ?: 30530000000;
->sum('total_amount');
return $amount ?: 30530000000; // 임시 기본값 (305억)
}
/**