refactor: 进一步区分banner的pc与mobile

This commit is contained in:
2025-05-27 14:02:14 +08:00
parent 5b3a020b1a
commit 9fd3954b4f
5 changed files with 47 additions and 9 deletions

View File

@@ -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)
{