From 638791fb453ab3307c6e92cc699ca753d2126321 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Tue, 30 Apr 2024 01:09:57 +0800 Subject: [PATCH] 1 --- app/api/controller/Wxwholesaler.php | 2 -- app/common/library/wxserver/Wholesaler.php | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Wxwholesaler.php b/app/api/controller/Wxwholesaler.php index 0abd5598..44b46571 100644 --- a/app/api/controller/Wxwholesaler.php +++ b/app/api/controller/Wxwholesaler.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(); diff --git a/app/common/library/wxserver/Wholesaler.php b/app/common/library/wxserver/Wholesaler.php index 67fd75cf..4ea7f8a4 100644 --- a/app/common/library/wxserver/Wholesaler.php +++ b/app/common/library/wxserver/Wholesaler.php @@ -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();