更新版本更新

This commit is contained in:
yaooo 2023-09-13 18:11:44 +08:00
parent 5fe997f320
commit fba8e28ca9

View File

@ -1312,16 +1312,18 @@ class Auth extends BaseController
public function appVersion() public function appVersion()
{ {
$brandArray = [ $brandArray = [
'HUAWEI', 'huawei',
'HUAWEI', 'honor',
'HUAWEI', 'iphone',
'HUAWEI', 'samsung',
'HUAWEI', 'xiaomi',
'HUAWEI', 'redmi',
'HUAWEI', 'mi',
'HUAWEI', 'oppo',
'HUAWEI', 'vivo',
'HUAWEI' 'nokia',
'meizu',
'moto'
]; ];
$type = $this->request->param('type', '-1'); $type = $this->request->param('type', '-1');
$version = $this->request->param('version', ''); $version = $this->request->param('version', '');
@ -1336,8 +1338,13 @@ class Auth extends BaseController
$queryBuilder = $queryBuilder->where('version', '>', $version); $queryBuilder = $queryBuilder->where('version', '>', $version);
} }
if ($phoneBrand) { if ($phoneBrand) {
foreach($brandArray as $b) {
$pos = stripos($phoneBrand, $b);
if ($pos !== false) {
$queryBuilder = $queryBuilder->where('phone_brand', $phoneBrand); $queryBuilder = $queryBuilder->where('phone_brand', $phoneBrand);
} }
}
}
$appInfo = ($queryBuilder->order('id', 'desc')->find()) ?? (object)[]; $appInfo = ($queryBuilder->order('id', 'desc')->find()) ?? (object)[];
} }