From 8ee5e4eae89c77fcdb89ee0bddadab2fb58761d0 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 11 Sep 2023 15:53:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 0f2ba7f4..9c5faf97 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1310,9 +1310,17 @@ class Auth extends BaseController //获取app版本更新信息 public function appVersion() { + $type = $this->request->param('type', '-1'); $version = $this->request->param('version', ''); - $type = $this->request->param('type', '1'); - $appInfo = (Db::name('AppUpdate')->where('type', $type)->where('version', '>', $version)->order('id', 'desc')->find()) ?? (object)[]; + $phoneBrand = $this->request->param('phone_brand', ''); + $queryBuilder = Db::name('AppUpdate')->where('type', $type); + if ($version) { + $queryBuilder = $queryBuilder->where('version', '>', $version); + } + if ($phoneBrand) { + $queryBuilder = $queryBuilder->where('phone_brand', $phoneBrand); + } + $appInfo = ($queryBuilder->order('id', 'desc')->find()) ?? (object)[]; return app('json')->success(compact('appInfo')); } }