refactor: 进一步区分banner的pc与mobile
This commit is contained in:
@@ -23,6 +23,16 @@ class SysBannerModel extends SysBannerBaseModel
|
||||
return $this->hasMany(SysBannerItemModel::class, 'banner_id', 'id');
|
||||
}
|
||||
|
||||
// 所属平台范围查询
|
||||
public function scopeAtPlatform($query, string|array $platform)
|
||||
{
|
||||
if (is_array($platform)) {
|
||||
$query->whereIn('at_platform', $platform);
|
||||
return;
|
||||
}
|
||||
$query->where('at_platform', '=', $platform);
|
||||
}
|
||||
|
||||
// 唯一标识范围查询
|
||||
public function scopeUniqueLabel($query, string|array $unique_label)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user