minor fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user