minor fixes

This commit is contained in:
ludo
2023-12-09 21:02:28 +01:00
parent b5da5fc881
commit 2a429e4163
49 changed files with 448 additions and 266 deletions

View File

@@ -10,6 +10,16 @@ class SaleChannel extends Model
protected $table = 'shop_sale_channels';
public function customer_sale_channels()
{
return $this->hasMany(CustomerSaleChannel::class);
}
public function customers()
{
return $this->belongsToMany(Customer::class, CustomerSaleChannel::class)->wherePivotNull('deleted_at');
}
public function deliveries()
{
return $this->hasMany(Delivery::class);
@@ -29,4 +39,9 @@ class SaleChannel extends Model
{
return $query->where($this->table.'.code', $code);
}
public function scopeById($query, $id)
{
return $query->where($this->table.'.id', $id);
}
}