cache('__version__')->order('weigh desc,id desc')->select(); foreach ($versionlist as $k => $v) { // 版本正常且新版本号不等于验证的版本号且找到匹配的旧版本 if ($v['status'] == 'normal' && $v['new_version'] !== $version && \fast\Version::check($version, $v['old_version'])) { $updateversion = $v; break; } } if (isset($updateversion)) { $search = ['{version}', '{new_version}', '{download_url}', '{url}', '{package_size}']; $replace = [$version, $updateversion['new_version'], $updateversion['download_url'], $updateversion['download_url'], $updateversion['package_size']]; $upgradetext = str_replace($search, $replace, $updateversion['content']); return [ "enforce" => $updateversion['enforce'], "version" => $version, "new_version" => $updateversion['new_version'], "download_url" => $updateversion['download_url'], "package_size" => $updateversion['package_size'], "upgradetext" => $upgradetext ]; } return NULL; } }