wesmiler 2 vuotta sitten
vanhempi
commit
ab811bb918
1 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  1. 8 1
      app/Services/Api/AccountLogService.php

+ 8 - 1
app/Services/Api/AccountLogService.php

@@ -61,6 +61,7 @@ class AccountLogService extends BaseService
         $type = isset($params['type']) ? $params['type'] : 0;
         $coinType = isset($params['coin_type']) ? $params['coin_type'] : 0;
         $userType = isset($params['user_type']) ? $params['user_type'] : 0;
+        $tradeType = isset($params['trade_type']) ? $params['trade_type'] : 0;
         $userId = isset($params['user_id']) ? $params['user_id'] : 0;
         $merchId = isset($params['merch_id']) ? $params['merch_id'] : 0;
         if ($status > 0) {
@@ -92,11 +93,17 @@ class AccountLogService extends BaseService
             return false;
         }
 
-        $model = DB::table($table)->where($where)->where(function ($query) use ($userType, $year, $month) {
+        $model = DB::table($table)->where($where)->where(function ($query) use ($userType, $tradeType, $year, $month) {
             if ($userType > 0) {
                 $query->whereIn('user_type', [0, $userType]);
             }
 
+            if($tradeType == 1){
+                $query->where('actual_money','>',0);
+            }else if($tradeType==2){
+                $query->where('actual_money','<',0);
+            }
+
             $date = $year && $month ? "{$year}-{$month}" : '';
             $date = $date ? $date : date('Y-m');
             if ($month) {