本地生活首页列表数据暂时只展示东龙汇公司

This commit is contained in:
wangxiaowei 2024-09-29 23:22:41 +08:00
parent 9c72256da0
commit b044c17512

@ -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) {