self enable add switch

This commit is contained in:
xiaomlove
2026-04-09 10:52:58 +07:00
parent db4982f8f7
commit 9e632811ef
8 changed files with 11 additions and 11 deletions

View File

@@ -9,9 +9,10 @@ $title = nexus_trans('self-enable.title');
stdhead($title);
begin_main_frame();
begin_frame($title, true,10,"100%","center");
if ($CURUSER['enabled'] == 'yes') {
$unit = \App\Models\Setting::getSelfEnableBonus();
if ($unit <= 0) {
printf('<h3>%s</h3>', nexus_trans('self-enable.feature_disabled'));
} elseif ($CURUSER['enabled'] == 'yes') {
printf('<h3>%s</h3>', nexus_trans('self-enable.enable_status_normal'));
} else {
$latestBanLog = \App\Models\UserBanLog::query()
@@ -21,7 +22,6 @@ if ($CURUSER['enabled'] == 'yes') {
if (!$latestBanLog) {
printf('<h3>%s</h3>', nexus_trans('self-enable.no_ban_info'));
} else {
$unit = \App\Models\Setting::getSelfEnableBonus();
$elapsedDay = ceil((time() - $latestBanLog->created_at->getTimestamp()) / 86400);
$total = $unit * $elapsedDay;
$isUserBonusEnough = $CURUSER['seedbonus'] >= $total;