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'));