diff --git a/app/admin/controller/Wxserve.php b/app/admin/controller/Wxserve.php index 93a19144..a928c98f 100644 --- a/app/admin/controller/Wxserve.php +++ b/app/admin/controller/Wxserve.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) { diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index 2f4a804e..c8426cf9 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -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 = [];