refactor: 修改几在模块支持多分类筛选

This commit is contained in:
2025-06-06 11:24:58 +08:00
parent be359bcb85
commit 9c149e7373
7 changed files with 43 additions and 3 deletions

View File

@@ -58,6 +58,10 @@ class AttachmentModel extends AttachmentBaseModel
public function scopeCategoryId($query, $value)
{
if (empty($value)) return;
if (is_array($value) || str_contains($value, ',')) {
$query->whereIn('category_id', $value);
return;
}
$query->where('category_id', '=', $value);
}
}