This commit is contained in:
Ludovic CANDELLIER
2021-08-24 23:41:10 +02:00
parent 82afe63c60
commit 67f490b2fe
15 changed files with 51 additions and 77 deletions

View File

@@ -61,16 +61,26 @@ class Article extends Model implements HasMedia
public function scopeByArticle($query, $id)
{
return $query->where('shop_articles.id', $id);
return $query->where($this->table . '.id', $id);
}
public function scopeByCategory($query, $category_id)
{
}
public function scopeByFamily($query, $id)
public function scopeByArticleNature($query, $id)
{
return $query->where('shop_articles.article_family_id', $id);
return $query->where($this->table . '.article_nature_id', $id);
}
public function scopeByProduct($query, $model)
{
return $query->where($this->table . '.product_type', $model);
}
public function scopeByProductId($query, $model_id)
{
return $query->where($this->table . '.product_id', $model_id);
}
public function registerMediaConversions(Media $media = null) : void