$this->config['appid'], "secret" => $this->config['secret'], "code" => $code ]; $resp = Http::asJson()->post($url,$param)->array(); print_r($resp); if ($resp['err_no'] == 0) { return $resp['data']; } return []; } /** * 查询标签组信息 - 用于支付 * @param int $goods_type */ public function getTagGroupId(int $goods_type) { $url = $this->gateway."api/trade_basic/v1/developer/tag_query/"; $param = [ "goods_type" => $goods_type ]; $resp = Http::asJson()->withHeaders($this->header)->post($url,$param)->array(); if ($resp['err_no'] == 0) { return $resp['data']; } return []; } /** * 小程序获取手机号码 * @param string $code * @return string */ public function getMobile(string $code = ""):string { $url = $this->gateway."api/apps/v1/get_phonenumber_info/"; $param = [ "code" => $code ]; $resp = Http::asJson()->withHeaders($this->header)->post($url,$param)->array(); if ($resp['err_no'] == 0) { return $resp['data']; } return ""; } }