WIN-2308041133\Administrator 3 天之前
父节点
当前提交
0fd7f90f9a
共有 1 个文件被更改,包括 19 次插入19 次删除
  1. 19 19
      app/model/api/User.php

+ 19 - 19
app/model/api/User.php

@@ -448,25 +448,25 @@ class User extends BaseModel
         }
         $cityModel = new CityModel();
         $serviceAreaWhere = null;
-        if (!empty($post["service_area"]) && is_array($post["service_area"])) {
-            $cityIds = [];
-            foreach ($post["service_area"] as $v) {
-                $stc = str_replace(['省', '市', '区', '县'], ['', '', '', ''], $v);
-                $str = str_replace(['辖'], ['市辖'], $stc);
-                $arr = explode(",", $str);
-                $city_id = $cityModel->where('merger_name', 'like', "%" . $arr[1] . "," . $arr[2])->value('id');
-                if (!$city_id) $city_id = $cityModel->where('merger_name', 'like', "%" . $arr[0] . "," . $arr[1])->value('id');
-                if ($city_id) $cityIds[] = $city_id;
-            }
-            if (!empty($cityIds)) {
-                $cityIdStr = implode(',', $cityIds);
-                $serviceAreaWhere = function ($query) use ($cityIdStr) {
-                    foreach (explode(',', $cityIdStr) as $cid) {
-                        $query->whereOr('find_in_set(' . intval($cid) . ',a.service_area)');
-                    }
-                };
-            }
-        }
+//        if (!empty($post["service_area"]) && is_array($post["service_area"])) {
+//            $cityIds = [];
+//            foreach ($post["service_area"] as $v) {
+//                $stc = str_replace(['省', '市', '区', '县'], ['', '', '', ''], $v);
+//                $str = str_replace(['辖'], ['市辖'], $stc);
+//                $arr = explode(",", $str);
+//                $city_id = $cityModel->where('merger_name', 'like', "%" . $arr[1] . "," . $arr[2])->value('id');
+//                if (!$city_id) $city_id = $cityModel->where('merger_name', 'like', "%" . $arr[0] . "," . $arr[1])->value('id');
+//                if ($city_id) $cityIds[] = $city_id;
+//            }
+//            if (!empty($cityIds)) {
+//                $cityIdStr = implode(',', $cityIds);
+//                $serviceAreaWhere = function ($query) use ($cityIdStr) {
+//                    foreach (explode(',', $cityIdStr) as $cid) {
+//                        $query->whereOr('find_in_set(' . intval($cid) . ',a.service_area)');
+//                    }
+//                };
+//            }
+//        }
 
         $totalModel = $this->alias("u")->leftJoin("info_audit a", "u.uid=a.uid")->where($where);
         if ($serviceAreaWhere) {