wang hou sheng 7 months ago
parent 0b32855f2f
commit 15cc0a40dc
  1. 13
      app/admin/controller/Wxserve.php
  2. 29
      app/common/library/wxserver/Server.php

@ -229,13 +229,12 @@ class Wxserve extends Controller
$obj = new Server();
$res = $obj->privacyInfo($appid);
if ($res == 'ok') {
$result = $obj->submitAudit($appid);
return $this->renderSuccess([$result]);
// if ($result) {
// return $this->renderSuccess('success');
// } else {
// return $this->renderSuccess([])
// }
$result = $obj->submitAuditOne($appid);
if ($result['status']) {
return $this->renderSuccess('success');
} else {
return $this->renderError($result['msg']);
}
} else {
return $this->renderError('隐私接口错误');
}

@ -698,7 +698,33 @@ class Server
return 0;
}
public function submitAudit($appid)
public function submitAuditOne($appid): array
{
$access_token = $this->authorizerAccessToken($appid);
if ($access_token) {
$url = 'https://api.weixin.qq.com/wxa/submit_audit?access_token=' . $access_token;
$data['item_list'] = $this->getAllCategory($appid);
if (!empty($data['item_list'])) {
$data = '{}';
} else {
$data = json_encode($data);
}
$result = $this->curlPost($url, $data);
$result = json_decode($result, true);
if (!empty($result) && intval($result['errcode']) == 0 && !empty($result['auditid'])) {
$model = new WxserverAccount();
$up['audit_status'] = 1;
$up['audit_reason'] = '';
$up['audit_time'] = date('Y-m-d H:i:s');
$up['auditid'] = $result['auditid'];
$model->update($up, ['appid' => $appid]);
return ['status' => true, 'msg' => 'success'];
}
}
return ['status' => false, 'msg' => !empty($result['errmsg']) ? $result['errmsg'] : '位置错误'];
}
public function submitAudit($appid): bool
{
$access_token = $this->authorizerAccessToken($appid);
if ($access_token) {
@ -711,7 +737,6 @@ class Server
}
$result = $this->curlPost($url, $data);
$result = json_decode($result, true);
return $result;
if (!empty($result) && intval($result['errcode']) == 0 && !empty($result['auditid'])) {
$model = new WxserverAccount();
$up['audit_status'] = 1;

Loading…
Cancel
Save