wang hou sheng 7 months ago
parent d9052b866c
commit 638791fb45
  1. 2
      app/api/controller/Wxwholesaler.php
  2. 4
      app/common/library/wxserver/Wholesaler.php

@ -8,7 +8,6 @@ use cores\BaseController;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Db;
class Wxwholesaler extends BaseController
{
@ -30,7 +29,6 @@ class Wxwholesaler extends BaseController
*/
public function redirect()
{
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入授权回调', 'created_at' => date('Y-m-d H:i:s')]);
$authorization_code = $this->request->get('auth_code');
if ($authorization_code) {
$obj = new \app\common\library\wxserver\Wholesaler();

@ -229,6 +229,8 @@ 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') {
//体验码
@ -690,6 +692,8 @@ 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