|
|
@@ -6,11 +6,13 @@ namespace App\Filters;
|
|
|
use App\Order;
|
|
|
use App\OrderIssue;
|
|
|
use App\OrderPackage;
|
|
|
+use App\Services\OwnerService;
|
|
|
use App\Traits\ModelSearchWay;
|
|
|
use App\User;
|
|
|
use App\WorkOrder;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Http\Request;
|
|
|
+use Illuminate\Support\Facades\Auth;
|
|
|
|
|
|
class WorkOrderFilters
|
|
|
{
|
|
|
@@ -66,6 +68,13 @@ class WorkOrderFilters
|
|
|
{
|
|
|
if(isset($this->params['data']))
|
|
|
$this->id(explode(',',$this->params['data']));
|
|
|
+
|
|
|
+ if (!isset($this->params['owner'])){
|
|
|
+ $owners = app(OwnerService::class)->getAuthorizedOwners();
|
|
|
+ $this->getOrderQuery()->whereIn('owner_id',$owners->map(function($item){
|
|
|
+ return $item->id;
|
|
|
+ }));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function beforeApply()
|