From c907c5900dd4987994c84a5608cbfcb65c709e24 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:26:42 +0800 Subject: [PATCH] 1 --- app/api/controller/Wxserver.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/api/controller/Wxserver.php b/app/api/controller/Wxserver.php index 732b0ca4..1a76b7db 100644 --- a/app/api/controller/Wxserver.php +++ b/app/api/controller/Wxserver.php @@ -8,6 +8,7 @@ use cores\BaseController; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; +use think\facade\Db; class Wxserver extends BaseController { @@ -45,12 +46,16 @@ class Wxserver extends BaseController public function callback() { + $time = date('Y-m-d H:i:s'); + Db::table('yoshop_wx_server')->insertGetId(['content' => '推送开始', 'created_at' => $time]); $query = $this->request->query(); $xmlData = file_get_contents("php://input"); if ($query) { + Db::table('yoshop_wx_server')->insertGetId(['content' => $query, 'created_at' => $time]); $arr = explode('/', $query); $appid = end($arr); if ($xmlData && $appid) { + Db::table('yoshop_wx_server')->insertGetId(['content' => $xmlData, 'created_at' => $time]); $obj = new \app\common\library\wxserver\Server(); $data = $obj->decryptXml($xmlData); if (!empty($data['MsgType']) && $data['MsgType'] == 'event' && !empty($data['Event'])) {