排行榜

This commit is contained in:
2026-01-09 19:13:31 +08:00
parent 446af258b9
commit 5e37cddc82

View File

@@ -152,15 +152,7 @@ class GiveGiftBases extends Model
$endTime = $params['end_time'];
if (!$userId) {
$this->error('用户ID不能为空');
}
$cacheKey = "gift:user:stats:{$userId}:" . date('Ymd', $startTime) . '-' . date('Ymd', $endTime);
$cachedData = Cache::get($cacheKey);
if ($cachedData !== false) {
Log::info("从缓存获取用户统计: {$cacheKey}");
$this->success('获取成功', $cachedData);
return ['code'=>0,'msg'=>'用户ID不能为空','data'=>null];
}
$where = ['user_id' => $userId];