|
@@ -12,6 +12,7 @@ use App\Shop;
|
|
|
use App\Traits\ModelSearchWay;
|
|
use App\Traits\ModelSearchWay;
|
|
|
use App\User;
|
|
use App\User;
|
|
|
use App\WorkOrder;
|
|
use App\WorkOrder;
|
|
|
|
|
+use App\WorkOrderProcessLog;
|
|
|
use Carbon\Carbon;
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
@@ -48,6 +49,7 @@ class WorkOrderFilters
|
|
|
'log_content',
|
|
'log_content',
|
|
|
'tags',
|
|
'tags',
|
|
|
'shop_name',
|
|
'shop_name',
|
|
|
|
|
+ 'work_order_process_log',
|
|
|
];
|
|
];
|
|
|
protected $array_filter;
|
|
protected $array_filter;
|
|
|
protected $params = [];
|
|
protected $params = [];
|
|
@@ -59,8 +61,7 @@ class WorkOrderFilters
|
|
|
protected $orderIssueLogQuery;
|
|
protected $orderIssueLogQuery;
|
|
|
protected $orderIssueQuery;
|
|
protected $orderIssueQuery;
|
|
|
protected $shopQuery;
|
|
protected $shopQuery;
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ protected $workOrderProcessLogQuery;
|
|
|
|
|
|
|
|
public function __construct(Request $request)
|
|
public function __construct(Request $request)
|
|
|
{
|
|
{
|
|
@@ -181,6 +182,11 @@ class WorkOrderFilters
|
|
|
if ($this->orderIssueQuery){
|
|
if ($this->orderIssueQuery){
|
|
|
$this->queryBuilder->whereIn('work_orders.order_id', $this->orderIssueQuery);
|
|
$this->queryBuilder->whereIn('work_orders.order_id', $this->orderIssueQuery);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if($this->workOrderProcessLogQuery){
|
|
|
|
|
+ $this->queryBuilder->whereIn('work_orders.id', $this->workOrderProcessLogQuery);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$this->orderByTag();
|
|
$this->orderByTag();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -246,6 +252,14 @@ class WorkOrderFilters
|
|
|
return $this->shopQuery;
|
|
return $this->shopQuery;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getWorkOrderProcessLogQuery(): Builder
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->workOrderProcessLogQuery){
|
|
|
|
|
+ $this->workOrderProcessLogQuery = WorkOrderProcessLog::query()->select('work_order_id');
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->workOrderProcessLogQuery;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function id($id)
|
|
public function id($id)
|
|
|
{
|
|
{
|
|
|
if (is_array($id)) $this->queryBuilder->whereIn('work_orders.id', $id);
|
|
if (is_array($id)) $this->queryBuilder->whereIn('work_orders.id', $id);
|
|
@@ -404,4 +418,9 @@ class WorkOrderFilters
|
|
|
{
|
|
{
|
|
|
$this->searchWay($this->getShopQuery(),$shop_name,'shops.name');
|
|
$this->searchWay($this->getShopQuery(),$shop_name,'shops.name');
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public function work_order_process_log($work_order_process_log)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->searchWay($this->getWorkOrderProcessLogQuery(),$work_order_process_log,'work_order_process_logs.content');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|