1.本地生活上级列表优化

This commit is contained in:
xucong 2024-08-10 14:58:01 +08:00
parent 8a71d14016
commit a247a5d3e2

@ -21,6 +21,7 @@ class LocalStoreLogic extends Logic
$count = $model->where('is_delete',0)
->where($s1)
-where("shopLogo is not null")
->count();
// $lists = $model->where('is_delete',0)
// ->where($s)
@ -29,9 +30,10 @@ class LocalStoreLogic extends Logic
// ->select();
$size = $data['page_size'];
$page = ($data['page_no']-1)*$data['page_size'];
$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 *, 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 shopLogo is not null $s limit $page,$size";
// var_dump($sql);
$lists = Db::query($sql);
foreach($lists as $key=>$value){