Selaa lähdekoodia

增加筛选项

duqinya 6 vuotta sitten
vanhempi
commit
1b95bb7d1b
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      app/Repositories/ConfigCityManagementRepository.php

+ 10 - 0
app/Repositories/ConfigCityManagementRepository.php

@@ -22,6 +22,16 @@ class ConfigCityManagementRepository {
         if(isset($request['id'])){
             $where[] = ['id', '=', $request['id']];
         }
+        if(isset($request['express_type'])){
+            if ($request['express_type'] == 1){
+                $where[] = ['express_type', '!=', 2];//返回含有自提的
+            }elseif ($request['express_type'] == 2){
+                $where[] = ['express_type', '!=', 1];//返回含有快递的
+            }
+        }
+        if(isset($request['status'])){
+            $where[] = ['status', '=', $request['status']];
+        }
 
 
         return $this->configCityManagement->where($where)->orderBy('id', 'asc')->paginate($perPage);