refactor: 修改附件及视频分类查询

This commit is contained in:
2025-04-16 10:59:09 +08:00
parent f582a30478
commit 3d194a6491
2 changed files with 17 additions and 0 deletions

View File

@@ -29,4 +29,13 @@ class VideoModel extends VideoBaseModel
{
$query->where('recommend', '=', (int)$recommend);
}
// 所属分类范围查询
public function scopeCategory($query, $category)
{
if (is_null($category)) {
return;
}
$query->where('category_id', '=', $category);
}
}