diff --git a/app/api/logic/LocalStoreLogic.php b/app/api/logic/LocalStoreLogic.php index af0d625c..dc1382a0 100644 --- a/app/api/logic/LocalStoreLogic.php +++ b/app/api/logic/LocalStoreLogic.php @@ -17,6 +17,8 @@ class LocalStoreLogic extends Logic $model = new LocalStore; $distance = ""; $s = $s1 = ""; + + $city_where = []; if (isset($data['c_name'])) { if ($data['c_name'] != "") { $s1 = "address like '%" . $data['c_name'] . "%'"; @@ -29,7 +31,7 @@ class LocalStoreLogic extends Logic } $count = $model->where('is_delete', 0) - ->where('lstore_id', 22) + ->where($city_where) ->where($s1) ->where("store_state", 1) ->where("shopLogo is not null") @@ -44,7 +46,13 @@ class LocalStoreLogic extends Logic // $sql = "SELECT *, ST_Distance_Sphere(POINT(".$data['longitude'].",".$data['latitude']."),POINT(longitude, latitude)) AS distance // FROM ls_local_store where is_delete = 0 $s // ORDER BY distance limit $page,$size"; - $sql = "SELECT * FROM ls_local_store where lstore_id = 22 and is_delete = 0 and store_state = 1 and shopLogo is not null $s ORDER BY lstore_id asc limit " . $page . "," . $size; + + if (isset($data['c_name']) && $data['c_name'] == '嘉兴市') { + $sql = "SELECT * FROM ls_local_store where lstore_id = 22 and is_delete = 0 and store_state = 1 and shopLogo is not null $s ORDER BY lstore_id asc limit " . $page . "," . $size; + } else { + $sql = "SELECT * FROM ls_local_store where is_delete = 0 and store_state = 1 and shopLogo is not null $s ORDER BY lstore_id asc limit " . $page . "," . $size; + } + // var_dump($sql); $lists = Db::query($sql); foreach ($lists as $key => $value) {