更新app版本查询

This commit is contained in:
yaooo 2023-09-15 09:39:04 +08:00
parent fa1a2a9634
commit c30238a989

View File

@ -1339,14 +1339,18 @@ class Auth extends BaseController
$queryBuilder = $queryBuilder->where('version', '>', $version); $queryBuilder = $queryBuilder->where('version', '>', $version);
} }
if ($phoneBrand) { if ($phoneBrand) {
$pos = false;
foreach($brandArray as $b) { foreach($brandArray as $b) {
$pos = stripos($phoneBrand, $b); $pos = stripos($phoneBrand, $b);
if ($pos !== false) { if ($pos !== false) {
$queryBuilder = $queryBuilder->where('phone_brand', $b); $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')); return app('json')->success(compact('appInfo'));