wesmiler 5 miesięcy temu
rodzic
commit
281e9801a6
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      app/Services/Api/AccountService.php

+ 5 - 3
app/Services/Api/AccountService.php

@@ -238,9 +238,6 @@ class AccountService extends BaseService
             if($phoneType){
                 $where['phone_type'] = $phoneType;
             }
-            if($phoneService){
-                $where['phone_service'] = $phoneService;
-            }
         }else if($type==2){
             if($electricType){
                 $where['electric_type'] = $electricType;
@@ -252,6 +249,11 @@ class AccountService extends BaseService
         }
 
         $datas = PayMealsModel::where($where)
+            ->where(function($query) use($phoneService, $type){
+                if($type==1 && $phoneService){
+                    $query->where('phone_service',$phoneService)->orWhere('phone_service',0);
+                }
+            })
             ->orderBy('sort','desc')
             ->orderBy('id','asc')
             ->get();