|
@@ -448,25 +448,25 @@ class User extends BaseModel
|
|
|
}
|
|
}
|
|
|
$cityModel = new CityModel();
|
|
$cityModel = new CityModel();
|
|
|
$serviceAreaWhere = null;
|
|
$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);
|
|
$totalModel = $this->alias("u")->leftJoin("info_audit a", "u.uid=a.uid")->where($where);
|
|
|
if ($serviceAreaWhere) {
|
|
if ($serviceAreaWhere) {
|