Browse Source

add recharge stat2

laowu 23 hours ago
parent
commit
7b7cc8b99b

+ 3 - 1
app/Console/Commands/RecordPaidRewardDailyStatistics.php

@@ -54,11 +54,13 @@ class RecordPaidRewardDailyStatistics extends Command
         $dbStats = DB::table(TableName::QPRecordDB() . 'RecordPaidRewardDailyStatistics')
             ->lock('with(nolock)')
             ->where('DateID', date('Ymd', strtotime($day)))
+            ->whereIn('StatType', ['normal_recharge_chips', 'first_recharge_gift_chips', 'bankrupt_gift_chips',
+                'daily_gift_chips', 'vip_inactive_gift_chips', 'free_bonus_gift_chips', 'christmas_gift_chips', 'unknow_chips'])
             ->select('StatType', 'TotalAmount')
             ->get()->map(function ($item) {
                 return json_decode(json_encode($item), true);
             })->toArray();
-        $stats[] = $this->sumAll(array_merge($dbStats, $stats), 'total_send');
+        $stats[] = $this->sumAll($dbStats, 'chips_all');
 
         return $stats;
     }

+ 2 - 2
app/Services/OrderServices.php

@@ -373,7 +373,7 @@ class  OrderServices
                     305 => 'vip_inactive_gift',
                     402 => 'christmas_gift',
                 ];
-                $type = $typeMap[$GiftsID] ?? 'unknown';
+                $type = $typeMap[$GiftsID] ?? 'unknown_gift';
                 app(PaidRewardStatisticsService::class)
                     ->incrementRecordByDateIDAndType(date('Ymd'), $type, $give * NumConfig::NUM_VALUE);
             }
@@ -386,7 +386,7 @@ class  OrderServices
                 306 => 'free_bonus_gift_chips',
                 402 => 'christmas_gift_chips',
             ];
-            $type = $typeMap[$GiftsID] ?? 'unknown';
+            $type = $typeMap[$GiftsID] ?? 'unknown_chips';
             app(PaidRewardStatisticsService::class)
                 ->incrementRecordByDateIDAndType(date('Ymd'), $type, ($Recharge+$give) * NumConfig::NUM_VALUE);
             app(PaidRewardStatisticsService::class)