main
Jing Li 2024-05-05 23:02:49 +08:00
parent 65402eb793
commit f8c3f68010
1 changed files with 32 additions and 18 deletions

View File

@ -29,6 +29,7 @@ class AppVersionController extends Controller
switch ($os) {
case AppOs::Android:
if ($android->version > $version + 1) {
if (! $android->isApkUpdate()) {
$apkUpdateVersion = AppVersion::onlyReleased()
->where('os', AppOs::Android)
@ -37,13 +38,20 @@ class AppVersionController extends Controller
->latest('version')
->first();
// 全量包更新
if ($apkUpdateVersion) {
if ((string) $android->apk_url === '') {
$android->update_strategy = AppUpdateStrategy::Apk;
} else {
$android = $apkUpdateVersion;
}
}
}
}
break;
case AppOs::Ios:
if ($ios->version > $version + 1) {
if (! $ios->isApkUpdate()) {
$apkUpdateVersion = AppVersion::onlyReleased()
->where('os', AppOs::Ios)
@ -52,10 +60,16 @@ class AppVersionController extends Controller
->latest('version')
->first();
// 全量包更新
if ($apkUpdateVersion) {
if ((string) $ios->apk_url === '') {
$ios->update_strategy = AppUpdateStrategy::Apk;
} else {
$ios = $apkUpdateVersion;
}
}
}
}
break;
}