在腾讯地图中搜索门店
发布于 6 年前 作者 rdu 7430 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图){“districtid”:‘“440305”,“keyword”:“吉野家”,}  搜不到数据, {“errcode”:0,“errmsg”:“ok”,“data”:{“item”:[]}}  
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo
2 回复

http://wx.bilalipay.com/wxvipcard/scan/search?wid=87   用这个接口访问。

6.在腾讯地图中搜索门店

请求方式: POST(请使用https协议)
https://api.weixin.qq.com/wxa/search_map_poi?access_token=TOKEN

//在腾讯地图中搜索门店

const GET_POI_UID = 'https://api.weixin.qq.com/wxa/search_map_poi?';


public function searchMapPoi($data){
  if (!$this->access_token && !$this->checkAuth()) return false;
  $result = $this->http_post(self::GET_POI_UID.'access_token='.$this->access_token,self::json_encode($data));
  if ($result)
  {
     $json = json_decode($result,true);
     if (!$json || !empty($json['errcode'])) {
        $this->errCode = $json['errcode'];
        $this->errMsg = $json['errmsg'];
        return false;
     }
     return $json;
  }
  return false;
}

//调用

public function searchAction(){
   $row = array();
   $row['districtid']         = '440305';
   $row['keyword']        ='吉野家';
   //if(!$row['districtid'] || !$row['keyword']){ return $this->fail('参数丢失'); }
   //在腾讯地图中搜索门店
   $res = weixin::getCurWechat()->searchMapPoi($row);
   return $res;
}
回到顶部