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

This commit is contained in:
wangxiaowei 2024-09-29 23:27:52 +08:00
parent 198a18e999
commit ada820e6e2

@ -17,14 +17,21 @@ 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'] . "%'";
$s = "and address like '%" . $data['c_name'] . "%'";
}
if ($data['c_name'] == '嘉兴市') {
$city_where[] = ['lstore_id', '=', 22];
}
}
$count = $model->where('is_delete', 0)
->where($city_where)
->where($s1)
->where("store_state", 1)
->where("shopLogo is not null")
@ -39,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 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) {