Initial reseller domain report, enable editing domain service details
This commit is contained in:
25
app/Traits/ScopeServiceActive.php
Normal file
25
app/Traits/ScopeServiceActive.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Add a ScopeActive to an Eloquent Model to only show active services (including those soon to be active)
|
||||
*/
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Models\Service;
|
||||
|
||||
trait ScopeServiceActive
|
||||
{
|
||||
/**
|
||||
* Only query active service records
|
||||
*/
|
||||
public function scopeServiceActive($query)
|
||||
{
|
||||
return $query->where(function($q) {
|
||||
return $q->where('ab_service.active',TRUE)
|
||||
->orWhere(function($q) {
|
||||
return $q->whereNotNull('order_status')
|
||||
->whereNotIn('ab_service.order_status',Service::INACTIVE_STATUS);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user