Rework service, removed redundant code, service invoicing improvements
This commit is contained in:
@@ -14,12 +14,23 @@ trait ScopeServiceActive
|
||||
*/
|
||||
public function scopeServiceActive($query)
|
||||
{
|
||||
return $query->where(function($q) {
|
||||
return $q->where('services.active',TRUE)
|
||||
->orWhere(function($q) {
|
||||
return $q->whereNotNull('order_status')
|
||||
->whereNotIn('services.order_status',Service::INACTIVE_STATUS);
|
||||
});
|
||||
});
|
||||
return $query
|
||||
->where(fn($q)=>
|
||||
$q->where('services.active',TRUE)
|
||||
->orWhere(fn($q)=>
|
||||
$q->whereNotNull('order_status')
|
||||
->whereNotIn('services.order_status',Service::INACTIVE_STATUS))
|
||||
);
|
||||
}
|
||||
|
||||
public function scopeServiceInactive($query)
|
||||
{
|
||||
return $query
|
||||
->where(fn($q)=>
|
||||
$q->where('services.active',FALSE)
|
||||
->orWhere(fn($q)=>
|
||||
$q->whereNotNull('order_status')
|
||||
->whereIn('services.order_status',Service::INACTIVE_STATUS))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user