This commit is contained in:
ludo
2025-01-03 03:46:45 +01:00
parent b3fbfc38e7
commit befaa40b48
44 changed files with 442 additions and 165 deletions

View File

@@ -191,6 +191,10 @@ class Article extends Model implements HasMedia
{
return $tagId ? $query->whereHas('tags', function ($query) use ($tagId) {
$query->byId($tagId);
})->orWhereHasMorph('product', [Variety::class], function($query) use ($tagId) {
$query->whereHas('tags', function ($query) use ($tagId) {
$query->where('id', $tagId);
});
}) : $query;
}
@@ -198,6 +202,10 @@ class Article extends Model implements HasMedia
{
return $tags ? $query->whereHas('tags', function ($query) use ($tags) {
$query->byIds($tags);
})->orWhereHasMorph('product', [Variety::class], function($query) use ($tags) {
$query->whereHas('tags', function ($query) use ($tags) {
$query->whereIntegerInRaw('id', $tags);
});
}) : $query;
}