Add new search of articles
This commit is contained in:
@@ -28,7 +28,6 @@ class Tariff extends Model
|
||||
|
||||
public function sale_channels()
|
||||
{
|
||||
// return $this->HasManyThrough(SaleChannel::class, PriceList::class);
|
||||
return $this->HasManyThrough(SaleChannel::class, PriceList::class, 'id', 'id', 'id', 'sale_channel_id');
|
||||
}
|
||||
|
||||
@@ -73,10 +72,10 @@ class Tariff extends Model
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->byStatus(0)->byPriceListsActive();
|
||||
return $query->byStatus(0)->hasPriceListsActive();
|
||||
}
|
||||
|
||||
public function scopeByPriceListsActive($query)
|
||||
public function scopeHasPriceListsActive($query)
|
||||
{
|
||||
return $query->whereHas('price_lists', function ($query) {
|
||||
$query->active();
|
||||
|
||||
Reference in New Issue
Block a user