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.
25 lines
576 B
25 lines
576 B
<?php
|
|
|
|
namespace App\Model\v3;
|
|
|
|
use App\Model\Model;
|
|
use Hyperf\Database\Model\Builder;
|
|
use Hyperf\Database\Model\SoftDeletes;
|
|
|
|
class Banner extends Model
|
|
{
|
|
use SoftDeletes;
|
|
protected $table = 'lanzu_banners';
|
|
|
|
protected $visible = [
|
|
'id', 'cover', 'cover_type', 'title', 'subtitle', 'path', 'path_type', 'bg_color'
|
|
];
|
|
|
|
protected function boot(): void
|
|
{
|
|
parent::boot();
|
|
self::addGlobalScope('normal', function (Builder $builder) {
|
|
return $builder->where(['status' => 1])->orderBy('sort', 'desc');
|
|
});
|
|
}
|
|
}
|