medal add gift_fee_factor and user_medal add priority

This commit is contained in:
xiaomlove
2023-01-29 20:00:58 +08:00
parent fb803d1989
commit 0845bca268
25 changed files with 335 additions and 55 deletions

View File

@@ -459,9 +459,9 @@ class User extends Authenticatable implements FilamentUser, HasName
public function medals(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Medal::class, 'user_medals', 'uid', 'medal_id')
->withPivot(['id', 'expire_at', 'status'])
->withPivot(['id', 'expire_at', 'status', 'priority'])
->withTimestamps()
->orderByPivot('id', 'desc')
->orderByPivot('priority', 'desc')
;
}