Преглед изворни кода

Weenier 168otc项目部署 0630

wesmiler пре 3 година
родитељ
комит
9af971ec41
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      app/Services/BaseService.php

+ 6 - 0
app/Services/BaseService.php

@@ -154,6 +154,12 @@ class BaseService
             if($businessId>0){
                 $query->where(['business_id'=> $businessId]);
             }
+            
+            $userType = isset($param['user_type'])? $param['user_type'] : 0;
+            if($userType){
+                $userType = explode(',', $userType);
+                $query->whereIn('user_type', $userType);
+            }
         })->when($sort, function ($query, $sort) {
             foreach ($sort as $v) {
                 $query->orderBy($v[0], $v[1]);