|
@@ -54,6 +54,7 @@ class WorkOrderFilters
|
|
|
protected $orderPackageQuery;
|
|
protected $orderPackageQuery;
|
|
|
protected $issueTypeQuery;
|
|
protected $issueTypeQuery;
|
|
|
protected $orderIssueLogQuery;
|
|
protected $orderIssueLogQuery;
|
|
|
|
|
+ protected $orderIssueQuery;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -148,9 +149,9 @@ class WorkOrderFilters
|
|
|
public function afterFileIssueType()
|
|
public function afterFileIssueType()
|
|
|
{
|
|
{
|
|
|
if (Gate::allows('订单管理-工单处理-客服编辑') || Gate::allows('订单管理-工单处理-货主编辑')) {
|
|
if (Gate::allows('订单管理-工单处理-客服编辑') || Gate::allows('订单管理-工单处理-货主编辑')) {
|
|
|
- $this->getOrderIssueQuery()->whereIn('name', ['拦截','取消拦截', '信息更改', '其他', '快递异常', '错漏发', '破损', '快递丢件']);
|
|
|
|
|
|
|
+ $this->getOrderIssueTypeQuery()->whereIn('name', ['拦截','取消拦截', '信息更改', '其他', '快递异常', '错漏发', '破损', '快递丢件']);
|
|
|
} else if (Gate::allows('订单管理-工单处理-承运商编辑')) {
|
|
} else if (Gate::allows('订单管理-工单处理-承运商编辑')) {
|
|
|
- $this->getOrderIssueQuery()->whereIn('name', ['拦截','取消拦截', '信息更改', '破损', '快递丢件', '快递异常']);
|
|
|
|
|
|
|
+ $this->getOrderIssueTypeQuery()->whereIn('name', ['拦截','取消拦截', '信息更改', '破损', '快递丢件', '快递异常']);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -167,6 +168,10 @@ class WorkOrderFilters
|
|
|
if ($this->issueTypeQuery) {
|
|
if ($this->issueTypeQuery) {
|
|
|
$this->queryBuilder->whereIn('order_issue_type_id', $this->issueTypeQuery);
|
|
$this->queryBuilder->whereIn('order_issue_type_id', $this->issueTypeQuery);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->orderIssueQuery){
|
|
|
|
|
+ $this->queryBuilder->whereIn('work_orders.order_id', $this->orderIssueQuery);
|
|
|
|
|
+ }
|
|
|
$this->orderByTag();
|
|
$this->orderByTag();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -199,7 +204,7 @@ class WorkOrderFilters
|
|
|
return $this->orderPackageQuery;
|
|
return $this->orderPackageQuery;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getOrderIssueQuery(): Builder
|
|
|
|
|
|
|
+ public function getOrderIssueTypeQuery(): Builder
|
|
|
{
|
|
{
|
|
|
if (!$this->issueTypeQuery) {
|
|
if (!$this->issueTypeQuery) {
|
|
|
$this->issueTypeQuery = OrderIssueType::query()->select('id');
|
|
$this->issueTypeQuery = OrderIssueType::query()->select('id');
|
|
@@ -207,6 +212,15 @@ class WorkOrderFilters
|
|
|
return $this->issueTypeQuery;
|
|
return $this->issueTypeQuery;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public function getOrderIssueQuery(): Builder
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->orderIssueQuery) {
|
|
|
|
|
+ $this->orderIssueQuery = OrderIssue::query()->select('order_issues.order_id');
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->orderIssueQuery;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function getOrderIssueLogQuery(): Builder
|
|
public function getOrderIssueLogQuery(): Builder
|
|
|
{
|
|
{
|
|
|
if (!$this->orderIssueLogQuery) {
|
|
if (!$this->orderIssueLogQuery) {
|
|
@@ -323,13 +337,13 @@ class WorkOrderFilters
|
|
|
|
|
|
|
|
public function log_content($log_content)
|
|
public function log_content($log_content)
|
|
|
{
|
|
{
|
|
|
- $order_issue_process_log_query = OrderIssueProcessLog::query()->selectRaw('order_id')->where('content', 'like', $log_content);
|
|
|
|
|
|
|
+ $order_issue_process_log_query = OrderIssueProcessLog::query()->selectRaw('order_issue_id')->where('content', 'like', $log_content);
|
|
|
if (!array_key_exists('addtime',$this->params) ) {
|
|
if (!array_key_exists('addtime',$this->params) ) {
|
|
|
$order_issue_process_log_query->where('created_at', '>=', Carbon::now()->subDays(31));
|
|
$order_issue_process_log_query->where('created_at', '>=', Carbon::now()->subDays(31));
|
|
|
} else {
|
|
} else {
|
|
|
$order_issue_process_log_query->where('created_at', '>=', Carbon::now()->subDays($this->params['addtime']));
|
|
$order_issue_process_log_query->where('created_at', '>=', Carbon::now()->subDays($this->params['addtime']));
|
|
|
}
|
|
}
|
|
|
- $this->queryBuilder->whereIn('order_id', $order_issue_process_log_query);
|
|
|
|
|
|
|
+ $this->getOrderIssueQuery()->whereIn('id',$order_issue_process_log_query);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function status($status){
|
|
public function status($status){
|