|
|
|
@ -277,17 +277,20 @@ class Wholesaler |
|
|
|
|
/** |
|
|
|
|
* @notes:获取版本信息 |
|
|
|
|
* @param $appid |
|
|
|
|
* @return bool |
|
|
|
|
* @return array |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function getVersioninfo($appid): bool |
|
|
|
|
public function getVersioninfo($appid): array |
|
|
|
|
{ |
|
|
|
|
$msg = '操作失败'; |
|
|
|
|
$code = 0; |
|
|
|
|
$access_token = $this->authorizerAccessToken($appid); |
|
|
|
|
$url = 'https://api.weixin.qq.com/wxa/getversioninfo?access_token=' . $access_token; |
|
|
|
|
$result = $this->curlPost($url, '{}'); |
|
|
|
|
$result = json_decode($result, true); |
|
|
|
|
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { |
|
|
|
|
$up = []; |
|
|
|
|
$code = 1; |
|
|
|
|
if (!empty($result['exp_info'])) { |
|
|
|
|
$up['exp_info'] = json_encode($result['exp_info']); |
|
|
|
|
} |
|
|
|
@ -298,9 +301,8 @@ class Wholesaler |
|
|
|
|
$model = new WxwholesalerAccount(); |
|
|
|
|
$model->update($up, ['appid' => $appid]); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
return ['code' => $code, 'msg' => !empty($result['errmsg']) ? $result['errmsg'] : $msg]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|