新增聊天室成就系统与消息保留策略
This commit is contained in:
@@ -261,6 +261,22 @@ class User extends Authenticatable
|
||||
return $this->hasMany(DailySignIn::class, 'user_id')->latest('sign_in_date');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联:用户已解锁和进行中的成就记录。
|
||||
*/
|
||||
public function achievements(): HasMany
|
||||
{
|
||||
return $this->hasMany(UserAchievement::class, 'user_id')->latest('achieved_at');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联:用户各成就的最新进度快照。
|
||||
*/
|
||||
public function achievementProgress(): HasMany
|
||||
{
|
||||
return $this->hasMany(UserAchievementProgress::class, 'user_id')->latest('last_scanned_at');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联:用户全部身份徽章。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user