invert query from offers->articles to articles->offers
This commit is contained in:
@@ -38,6 +38,11 @@ class Offer extends Model
|
||||
return $this->belongsTo(Variation::class);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('status_id', 1);
|
||||
}
|
||||
|
||||
public function scopeByArticle($query, $id)
|
||||
{
|
||||
return $query->where('article_id', $id);
|
||||
|
||||
Reference in New Issue
Block a user