1.获取距离
This commit is contained in:
parent
5f56522a0f
commit
08cb158983
@ -215,10 +215,17 @@ class LocalStore extends Api
|
||||
public function getLocalShopById()
|
||||
{
|
||||
$id = $this->request->post('id');
|
||||
$latitude = $this->request->post('latitude');
|
||||
$longitude = $this->request->post('longitude');
|
||||
$latitude = $this->request->post('latitude',0);
|
||||
$longitude = $this->request->post('longitude',0);
|
||||
$user_id = $this->user_id;
|
||||
$u = "";
|
||||
if($latitude == 0){
|
||||
$u = "user_id = $user_id";
|
||||
}
|
||||
|
||||
$result = Db::name('local_store')
|
||||
->where(['lstore_id' => $id, 'user_id' => $this->user_id, 'store_state' => 1])
|
||||
->where(['lstore_id' => $id,'store_state' => 1])
|
||||
->where($u)
|
||||
->order('create_time', 'desc')
|
||||
->field('latitude,longitude,lstore_id, store_state, header_image, store_nickname, pay_image,shopName,shopLogo')
|
||||
->find();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user