wang hou sheng 9 months ago
parent 5e420f7cce
commit b0a6d35bfb
  1. 2
      app/admin/controller/Wxserve.php
  2. 40
      app/common/library/wxserver/Server.php

@ -82,7 +82,7 @@ class Wxserve extends Controller
$item['experience_code'] = $this->request->domain(true) . $item['experience_code'] . '?time=' . time();
}
if ($item['audit_status'] == 0) {
$item['audit_status_text'] = '未发布版本';
$item['audit_status_text'] = '--';
} elseif ($item['audit_status'] == 1) {
$item['audit_status_text'] = '审核中';
} elseif ($item['audit_status'] == 2) {

@ -544,6 +544,46 @@ class Server
return false;
}
/**
* @notes:检测审核状态
* @param $appid
* @param $auditid
* @return bool
* @author: wanghousheng
*/
public function getAuditStatus($appid, $auditid): bool
{
$access_token = $this->authorizerAccessToken($appid);
if ($access_token && $auditid) {
$url = 'https://api.weixin.qq.com/wxa/get_auditstatus?access_token=' . $access_token;
$data['auditid'] = $auditid;
$result = $this->curlPost($url, json_encode($data));
$result = json_decode($result, true);
if (!empty($result) && intval($result['errcode']) == 0 && isset($result['status'])) {
$status = intval($result['status']);
$up = [];
if ($status == 0) {
$up['audit_status'] = 2;
} elseif ($status == 1) {
$up['audit_status'] = 3;
} elseif ($status == 2) {
$up['audit_status'] = 1;
} elseif ($status == 4) {
$up['audit_status'] = 4;
}
if (!empty($result['reason'])) {
$up['audit_reason'] = $result['reason'];
}
if ($up) {
$model = new WxserverAccount();
$model->update($up, ['appid' => $appid]);
}
return true;
}
}
return false;
}
public function getAllCategory($appid): array
{
$data = [];

Loading…
Cancel
Save