Files
nexusphp/app/Models/UserMedal.php

28 lines
565 B
PHP
Raw Normal View History

2022-01-19 23:54:55 +08:00
<?php
namespace App\Models;
class UserMedal extends NexusModel
{
2025-07-14 21:03:09 +07:00
protected $fillable = ['uid', 'medal_id', 'expire_at', 'status', 'bonus_addition_expire_at'];
2022-03-19 14:55:43 +08:00
const STATUS_NOT_WEARING = 0;
const STATUS_WEARING = 1;
public function getWearingStatusTextAttribute()
{
return nexus_trans("medal.wearing_status_text." . $this->status);
}
public function medal()
{
return $this->belongsTo(Medal::class, 'medal_id');
}
public function user()
{
return $this->belongsTo(User::class, 'uid');
}
2022-03-19 14:55:43 +08:00
2022-01-19 23:54:55 +08:00
}