fix pbg task payment
This commit is contained in:
@@ -486,14 +486,14 @@ class BigDataResumeController extends Controller
|
||||
{
|
||||
try {
|
||||
// Get sum and count from PbgTaskPayment model
|
||||
$totalSum = PbgTaskPayment::whereYear('payment_date', date('Y'))->sum('pad_amount') ?? 0;
|
||||
$totalCount = PbgTaskPayment::whereYear('payment_date', date('Y'))->count() ?? 0;
|
||||
$stats = PbgTaskPayment::whereNotNull('payment_date_raw')
|
||||
->whereNotNull('retribution_total_pad')
|
||||
->whereYear('payment_date_raw', date('Y'))
|
||||
->selectRaw('SUM(retribution_total_pad) as total_sum, COUNT(*) as total_count')
|
||||
->first();
|
||||
|
||||
Log::info("Real-time PBG Task Payments Data", [
|
||||
'total_records' => $totalCount,
|
||||
'total_sum' => $totalSum,
|
||||
'source' => 'pbg_task_payments table'
|
||||
]);
|
||||
$totalSum = $stats->total_sum ?? 0;
|
||||
$totalCount = $stats->total_count ?? 0;
|
||||
|
||||
return [
|
||||
'sum' => (float) $totalSum,
|
||||
|
||||
Reference in New Issue
Block a user