invert query from offers->articles to articles->offers
This commit is contained in:
@@ -86,6 +86,13 @@ class Article extends Model implements HasMedia
|
||||
|
||||
public function scopeWithOffers($query)
|
||||
{
|
||||
return $query->has('Offers');
|
||||
return $query->has('offers');
|
||||
}
|
||||
|
||||
public function scopeWithCurrentOffers($query)
|
||||
{
|
||||
return $query->whereHas('offers', function ($query) {
|
||||
$query->where('status_id', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user