Add prices and filtering by sale_channel with default

This commit is contained in:
Ludovic CANDELLIER
2022-02-22 22:32:46 +01:00
parent 3c3481b39d
commit f8c686caa3
6 changed files with 43 additions and 13 deletions

View File

@@ -23,4 +23,9 @@ class SaleChannel extends Model
{
return $this->hasManyThrough(Tariff::class, PriceList::class, 'sale_channel_id', 'id', 'id', 'tariff_id');
}
public function scopeByCode($query, $code)
{
return $query->where($this->table . '.code', $code);
}
}