wesmiler 1 год назад
Родитель
Сommit
493f47a9e7
2 измененных файлов с 8 добавлено и 2 удалено
  1. 7 1
      app/Services/Api/BalanceLogService.php
  2. 1 1
      app/Services/Api/MemberService.php

+ 7 - 1
app/Services/Api/BalanceLogService.php

@@ -70,7 +70,13 @@ class BalanceLogService extends BaseService
             unset($where['coin_type']);
         }
 
-        $data = $this->model->where($where)->where(function ($query)use($status){
+        $data = $this->model->where($where)->where(function ($query)use($status,$coinType){
+            if($coinType){
+                $query->where('coin_type', $coinType);
+            }else{
+                $query->whereIn('coin_type', [1,2]);
+            }
+
             if($status){
                 $query->where('status', $status);
             }else{

+ 1 - 1
app/Services/Api/MemberService.php

@@ -264,7 +264,7 @@ class MemberService extends BaseService
 
         if($type == 1){
             $info['recharge_total'] = BalanceLogService::make()->getCountByType($userId, 1);
-            $info['withdraw_total'] = BalanceLogService::make()->getCountByType($userId, 2);
+            $info['withdraw_total'] = BalanceLogService::make()->getCountByType($userId, 2, 0, 0);
         }
 
         RedisService::set($cacheKey, $info, rand(5,10));