You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
755 B
37 lines
755 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Blacklist extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'venue_id',
|
|
'visitor_name',
|
|
'visitor_phone',
|
|
'reason',
|
|
'revoked_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'revoked_at' => 'datetime',
|
|
];
|
|
|
|
/** 仍在灰名单中(未软解除) */
|
|
public function scopeActive(Builder $query): Builder
|
|
{
|
|
return $query->whereNull('revoked_at');
|
|
}
|
|
|
|
public function venue(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Venue::class);
|
|
}
|
|
}
|