wang hou sheng 9 months ago
parent dac6c74d08
commit c560784001
  1. 13
      app/common/library/wxserver/Wholesaler.php
  2. 0
      config/cache-bak.php

@ -205,12 +205,10 @@ class Wholesaler
*/
public function commit($appid, $template_id): bool
{
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入发体验版', 'created_at' => date('Y-m-d H:i:s')]);
$version = '';
$access_token = $this->authorizerAccessToken($appid);
//获取模板
$templatelist = $this->getTemplatelist();
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($templatelist), 'created_at' => date('Y-m-d H:i:s')]);
if ($templatelist) {
foreach ($templatelist as $value) {
if (!empty($value['user_version']) && $value['template_id'] == $template_id) {
@ -219,7 +217,6 @@ class Wholesaler
}
}
}
Db::table('yoshop_wx_server')->insertGetId(['content' => "版本信息$version", 'created_at' => date('Y-m-d H:i:s')]);
if ($version == '') {
throwError('模板不存在');
}
@ -232,8 +229,6 @@ class Wholesaler
$data['ext_json'] = json_encode($ext_json);
$url = 'https://api.weixin.qq.com/wxa/commit?access_token=' . $access_token;
$result = $this->curlPost($url, json_encode($data));
Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]);
Db::table('yoshop_wx_server')->insertGetId(['content' => '发布体验版信息', 'created_at' => date('Y-m-d H:i:s')]);
$result = json_decode($result, true);
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
//体验码
@ -505,6 +500,8 @@ class Wholesaler
$data['uploaddomain'] = $domain;
$data['downloaddomain'] = $domain;
$result = $this->curlPost($url, json_encode($data));
Db::table('yoshop_wx_server')->insertGetId(['content' => "设置域名信息", 'created_at' => date('Y-m-d H:i:s')]);
Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]);
$result = json_decode($result, true);
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
return true;
@ -537,6 +534,8 @@ class Wholesaler
$data['owner_setting']['contact_qq'] = '527264601';
$data['owner_setting']['notice_method'] = '公告';
$result = $this->curlPost($url, json_encode($data));
Db::table('yoshop_wx_server')->insertGetId(['content' => "设置隐私信息", 'created_at' => date('Y-m-d H:i:s')]);
Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]);
$result = json_decode($result, true);
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
return true;
@ -646,6 +645,8 @@ class Wholesaler
$data['action'] = 'set';
$data['webviewdomain'] = $domain;
$result = $this->curlPost($url, json_encode($data));
Db::table('yoshop_wx_server')->insertGetId(['content' => "业务域名", 'created_at' => date('Y-m-d H:i:s')]);
Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]);
$result = json_decode($result, true);
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
return true;
@ -695,8 +696,6 @@ class Wholesaler
$data = json_encode($data);
}
$result = $this->curlPost($url, $data);
Db::table('yoshop_wx_server')->insertGetId(['content' => '发布正式版版信息', 'created_at' => date('Y-m-d H:i:s')]);
Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]);
$result = json_decode($result, true);
if (!empty($result) && intval($result['errcode']) == 0 && !empty($result['auditid'])) {
$model = new WxwholesalerAccount();

Loading…
Cancel
Save