|
@@ -9,11 +9,7 @@ use Illuminate\Database\Query\Builder;
|
|
|
|
|
|
/**
|
|
|
* @property int $id 封禁记录ID
|
|
|
- * todo: delete this
|
|
|
- * @property string $user_name 用户名
|
|
|
* @property int $user_id 用户ID
|
|
|
- * todo: delete this as well
|
|
|
- * @property string $email 用户邮箱
|
|
|
* @property int $detect_number 本次违规次数
|
|
|
* @property int $ban_time 封禁时长
|
|
|
* @property int $start_time 封禁开始时间
|
|
@@ -35,6 +31,14 @@ final class DetectBanLog extends Model
|
|
|
return User::find($this->user_id);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户名
|
|
|
+ */
|
|
|
+ public function userName(): string
|
|
|
+ {
|
|
|
+ return $this->user() === null ? '用户不存在' : $this->user()->user_name;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 封禁结束时间
|
|
|
*/
|