功能:今日风云榜独立页 /leaderboard/today,导航新增「今日榜」按钮
This commit is contained in:
@@ -100,10 +100,31 @@ class LeaderboardController extends Controller
|
||||
|
||||
return view('leaderboard.index', compact(
|
||||
'topLevels', 'topExp', 'topWealth', 'topCharm',
|
||||
'todayExp', 'todayGold', 'todayCharm',
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 今日风云榜独立页(经验/金币/魅力今日排行)
|
||||
*/
|
||||
public function todayIndex(): View
|
||||
{
|
||||
$todayTtl = 60 * 5;
|
||||
$today = today()->toDateString();
|
||||
$topN = (int) \App\Models\Sysparam::getValue('leaderboard_limit', '20');
|
||||
|
||||
$todayExp = Cache::remember("leaderboard:today_exp:{$today}", $todayTtl,
|
||||
fn () => $this->currencyService->todayLeaderboard('exp', $topN, $today)
|
||||
);
|
||||
$todayGold = Cache::remember("leaderboard:today_gold:{$today}", $todayTtl,
|
||||
fn () => $this->currencyService->todayLeaderboard('gold', $topN, $today)
|
||||
);
|
||||
$todayCharm = Cache::remember("leaderboard:today_charm:{$today}", $todayTtl,
|
||||
fn () => $this->currencyService->todayLeaderboard('charm', $topN, $today)
|
||||
);
|
||||
|
||||
return view('leaderboard.today', compact('todayExp', 'todayGold', 'todayCharm'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户个人流水日志页(查询自己的经验/金币/魅力操作历史)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user