fix orders datatables on profile, fix deliveries for profile (public & active)
This commit is contained in:
@@ -42,9 +42,14 @@ class Delivery extends Model
|
||||
return $this->belongsTo(SaleChannel::class);
|
||||
}
|
||||
|
||||
public function scopeActive()
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $this->byActive(1);
|
||||
return $query->byActive(1);
|
||||
}
|
||||
|
||||
public function scopeInactive($query)
|
||||
{
|
||||
return $query->byActive(0);
|
||||
}
|
||||
|
||||
public function scopeByActive($query, $active)
|
||||
@@ -62,18 +67,13 @@ class Delivery extends Model
|
||||
return $query->where($this->table.'.at_house', 1);
|
||||
}
|
||||
|
||||
public function scopeInactive()
|
||||
public function scopeManaged($query)
|
||||
{
|
||||
return $this->byActive(0);
|
||||
return $query->byPublic(0);
|
||||
}
|
||||
|
||||
public function scopeManaged()
|
||||
public function scopePublic($query)
|
||||
{
|
||||
return $this->byPublic(0);
|
||||
}
|
||||
|
||||
public function scopePublic()
|
||||
{
|
||||
return $this->byPublic(1);
|
||||
return $query->byPublic(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user