更新版本查询
This commit is contained in:
parent
00c5aad51b
commit
8ee5e4eae8
@ -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'));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user