refactor: banner添加语言区分查询

This commit is contained in:
2025-03-26 10:56:14 +08:00
parent b97f08f1ac
commit 6cd342ea56
3 changed files with 78 additions and 34 deletions

View File

@@ -17,6 +17,13 @@ class SysBannerModel extends SysBannerBaseModel
// 软删除字段
protected $deleteTime = 'deleted_at';
// 按语言查询
public function scopeLanguage($query, $value)
{
if (is_null($value)) return;
$query->where('language_id', $value);
}
// 按名称搜索
public function searchNameAttr($query, $value, $data)
{