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] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=9D=99=E6=80=81=E8=B5=84?= =?UTF-8?q?=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'));