Browse Source

控制台

Gorden 6 months ago
parent
commit
b60712787f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      app/admin/service/statistics/OrderService.php

+ 5 - 0
app/admin/service/statistics/OrderService.php

@@ -26,6 +26,11 @@ class OrderService
             ->where('pay_category', '<>', 'RECHARGE')
             ->where('pay_category', '<>', 'CLEAR')
             ->sum('pay_amount');
+        $refundAmount = PayDetail::whereRaw('CAST(UNIX_TIMESTAMP(pay_paytimes) as SIGNED) > ? ' , [$todayTimeUnix])
+            ->where('pay_status', 'SUCCESS')
+            ->where('pay_category', '<>', 'RETURN')
+            ->sum('pay_amount');
+        $data['todayRevenue'] = $data['todayRevenue'] - $refundAmount;
         // 今日充值额
         $data['todayRecharge'] = Order::where('order_status_payment', 'SUCCESS')
             ->where('order_addtimes', '>', $todayTimeUnix)