上架审核版本 和用户 使用版本比对

This commit is contained in:
2025-12-23 14:10:29 +08:00
parent c95410311d
commit ea876dba28

View File

@@ -52,8 +52,12 @@ class Theme extends controller
$api_version = 0; $api_version = 0;
if ($system == 'iOS') { if ($system == 'iOS') {
$api_versions = db::name('version')->where(['type' => 2, 'status' => 1])->order('id', 'desc')->find(); $api_versions = db::name('version')->where(['type' => 2, 'status' => 1])->order('id', 'desc')->find();
$result = version_compare($api_versions['apiversion'],$app_version); //app的版本和用户使用的当前版本比对
if ($result < 0) { //$api_versions['newversion'] 是数据库当前的版本 也是用户使用的版本
//$app_version 有可能是appstore里面的审核版本
//审核版本给前端返回1
$result = version_compare($api_versions['newversion'],$app_version);
if ($result < 0) {//-1:前面版本小于后面版本,0:相等,1:前面版本大于后面版本
$api_version = 1; $api_version = 1;
} }
} }