fix orders datatables on profile, fix deliveries for profile (public & active)

This commit is contained in:
Ludovic CANDELLIER
2023-08-29 22:15:37 +02:00
parent 7addea00a2
commit 496274b4f4
10 changed files with 60 additions and 91 deletions

View File

@@ -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);
}
}