From c30238a989c8ea11ea6cd684e1ae9bdfbab8b2eb Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 15 Sep 2023 09:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0app=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= 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 2df4e11b..94ff747b 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1339,14 +1339,18 @@ class Auth extends BaseController $queryBuilder = $queryBuilder->where('version', '>', $version); } if ($phoneBrand) { + $pos = false; foreach($brandArray as $b) { $pos = stripos($phoneBrand, $b); if ($pos !== false) { $queryBuilder = $queryBuilder->where('phone_brand', $b); } } + if ($pos === false) { + $queryBuilder = $queryBuilder->where('phone_brand', ''); + } } - $appInfo = ($queryBuilder->order('id', 'desc')->fetchSql(false)->find()) ?? (object)[]; + $appInfo = ($queryBuilder->order('version', 'desc')->fetchSql(false)->find()) ?? (object)[]; } return app('json')->success(compact('appInfo'));