refactor: 修改文章及文章分类

This commit is contained in:
2025-01-15 10:19:01 +08:00
parent 24643affc9
commit 47968efa12
5 changed files with 32 additions and 0 deletions

View File

@@ -16,6 +16,12 @@ class ArticleCategoryModel extends ArticleCategoryBaseModel
// 软删除标记数据字段
protected $deleteTime = 'deleted_at';
// 根据语言查询
public function scopeLanguage($query, $lang_id)
{
$query->where('language_id', '=', $lang_id);
}
// 搜索分类名
public function searchNameAttr($query, $value, $data)
{

View File

@@ -46,6 +46,12 @@ class ArticleModel extends ArticleBaseModel
$query->where('id', '=', $value);
}
// 语言查询
public function scopeLanguage($query, $value)
{
$query->where('language_id', '=', $value);
}
// 分类查询
public function scopeCategory($query, $value)
{