change construction of articles/offers
This commit is contained in:
@@ -50,10 +50,15 @@ class PriceList extends Model
|
||||
return $query->where($this->table . '.status_id', $id);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->byStatus(0)->has('price_list_values');
|
||||
}
|
||||
|
||||
public function scopeByOffer($query, $id)
|
||||
{
|
||||
return $query->whereHas('offers', function ($query) use ($id) {
|
||||
$query->byOffer($id);
|
||||
$query->byID($id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user