whereInviterId(Auth::id());
}
public function inviter(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function invitee(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function getStatusLabelAttribute(): string
{
switch ($this->attributes['status']) {
case 0:
$status_label = ''.trans('home.invite_code_table_status_un').'';
break;
case 1:
$status_label = ''.trans('home.invite_code_table_status_yes').'';
break;
case 2:
$status_label = ''.trans('home.invite_code_table_status_expire').'';
break;
default:
$status_label = ' 未知 ';
}
return $status_label;
}
}