fix change user class + medal display

This commit is contained in:
xiaomlove
2023-01-10 17:25:53 +08:00
parent 3612edbb5b
commit d7d63c8fd2
20 changed files with 249 additions and 16 deletions

View File

@@ -15,7 +15,7 @@ class Medal extends NexusModel
self::GET_TYPE_GRANT => ['text' => 'Grant'],
];
protected $fillable = ['name', 'description', 'image_large', 'image_small', 'price', 'duration', 'get_type'];
protected $fillable = ['name', 'description', 'image_large', 'image_small', 'price', 'duration', 'get_type', 'display_on_medal_page'];
public $timestamps = true;

View File

@@ -43,4 +43,9 @@ class UserMeta extends NexusModel
return $this->status == self::STATUS_NORMAL && ($this->getRawOriginal('deadline') === null || ($this->deadline && $this->deadline->gte(now())));
}
public function user()
{
return $this->belongsTo(User::class, 'uid');
}
}