Fix on tarif with sale_channel

This commit is contained in:
Ludovic CANDELLIER
2022-03-30 15:46:10 +02:00
parent c4bb4fdd59
commit e312572bcc
4 changed files with 17 additions and 13 deletions

View File

@@ -53,7 +53,14 @@ class Tariff extends Model
->orWhere($this->table . '.code', 'LIKE', "${str}%");
}
public function scopeBySaleChanelDefault($query, $id)
public function scopeBySaleChannel($query, $id)
{
return $query->active()->whereHas('price_lists', function ($query) use ($id) {
$query->bySaleChannel($id);
});
}
public function scopeBySaleChannelDefault($query, $id)
{
return $query->where($this->table . '.sale_channel_id', $id);
}