From fba8e28ca90544f31090dcf392f6f58b31b7f0b8 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 13 Sep 2023 18:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 61f988cf..4934233e 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1312,16 +1312,18 @@ class Auth extends BaseController public function appVersion() { $brandArray = [ - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI', - 'HUAWEI' + 'huawei', + 'honor', + 'iphone', + 'samsung', + 'xiaomi', + 'redmi', + 'mi', + 'oppo', + 'vivo', + 'nokia', + 'meizu', + 'moto' ]; $type = $this->request->param('type', '-1'); $version = $this->request->param('version', ''); @@ -1336,7 +1338,12 @@ class Auth extends BaseController $queryBuilder = $queryBuilder->where('version', '>', $version); } if ($phoneBrand) { - $queryBuilder = $queryBuilder->where('phone_brand', $phoneBrand); + foreach($brandArray as $b) { + $pos = stripos($phoneBrand, $b); + if ($pos !== false) { + $queryBuilder = $queryBuilder->where('phone_brand', $phoneBrand); + } + } } $appInfo = ($queryBuilder->order('id', 'desc')->find()) ?? (object)[]; }