From b9b8d4b3e92ad205a92c6be8c0236471c879c492 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 25 Sep 2023 21:04:51 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=9D=99=E6=80=81?= =?UTF-8?q?=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 0f44370b..82b601da 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1387,6 +1387,7 @@ class Auth extends BaseController 'meizu', 'moto' ]; + Log::info("请求版本参数:" . json_encode(request()->param())); $type = $this->request->param('type', '-1'); $version = $this->request->param('version', ''); $phoneBrand = $this->request->param('phone_brand', ''); @@ -1412,7 +1413,10 @@ class Auth extends BaseController $queryBuilder = $queryBuilder->where('phone_brand', ''); } } - $appInfo = ($queryBuilder->order('version', 'desc')->fetchSql(false)->find()) ?? (object)[]; + $appInfo = $queryBuilder->order('version', 'desc')->fetchSql(false)->find(); + if (empty($appInfo)) { + $appInfo = (Db::name('AppUpdate')->where('type', $type)->where('version', '>', $version)->find()) ?? (object)[]; + } } return app('json')->success(compact('appInfo')); From 9e77cf641544620889692c5c6372bd1e5c7cd0c5 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Tue, 26 Sep 2023 09:53:33 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E6=9B=B4=E6=96=B0app=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 20 ++++++++++++++++++++ public/index.html | 2 +- route/api.php | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 82b601da..bdb01c8f 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1360,6 +1360,26 @@ class Auth extends BaseController return app('json')->success([]); } + //获取APP菜单 + public function appMenu() + { + $menuList = Db::name('app_menu')->where('is_show', 1)->where('is_disable', 0)->field(['id', 'pid', 'name', 'icon', 'sort', 'paths'])->order('sort', 'asc')->select()->toArray(); + $menuData = []; + foreach($menuList as $n) { + if ($n['pid'] == 0) { + $menuData[$n]; + } + } + foreach($menuData as $n) { + foreach($menuList as $ml) { + if ($n['id'] == $ml['pid']) { + $menuData['children'][] = $ml; + } + } + } + return app('json')->success($menuData); + } + //根据street_id获取商户信息 public function regionMerchant($street_id) { diff --git a/public/index.html b/public/index.html index 1b842b3f..d152ac93 100644 --- a/public/index.html +++ b/public/index.html @@ -2,4 +2,4 @@ document.write('') if(window.location.protocol == 'https:'){ document.write('') - }