From 67288da57efe5ba229c3ac77f0e8452b27d0f657 Mon Sep 17 00:00:00 2001 From: lemon <15040771@qq.com> Date: Thu, 23 Sep 2021 10:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Controllers/WorkorderController.php | 10 ++++++++-- app/AdminGuide/Controllers/WorkorderController.php | 10 ++++++++-- app/AdminSupplier/Controllers/WorkorderController.php | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/app/AdminAgent/Controllers/WorkorderController.php b/app/AdminAgent/Controllers/WorkorderController.php index 9ed9703..609a683 100755 --- a/app/AdminAgent/Controllers/WorkorderController.php +++ b/app/AdminAgent/Controllers/WorkorderController.php @@ -36,7 +36,11 @@ class WorkorderController extends AdminController $userList = $msgList = []; $workorder = \App\Models\Workorder::query() - ->with(['point','publisher']) + ->with(['point' => function($query) { + $query->withTrashed(); + },'publisher' => function($query) { + $query->withTrashed(); + }]) ->withCount(['items' => function($query) { $query->where('is_read', 0) ->where('point_id',Admin::user()->id) @@ -70,7 +74,9 @@ class WorkorderController extends AdminController } $workorderItem = WorkorderItem::query() - ->with(['publisher']) + ->with(['publisher' => function($query) { + $query->withTrashed(); + }]) ->where('workorder_id',$workorderId) ->get(); diff --git a/app/AdminGuide/Controllers/WorkorderController.php b/app/AdminGuide/Controllers/WorkorderController.php index c31a0b4..e742530 100755 --- a/app/AdminGuide/Controllers/WorkorderController.php +++ b/app/AdminGuide/Controllers/WorkorderController.php @@ -35,7 +35,11 @@ class WorkorderController extends AdminController $userList = $msgList = []; $workorder = \App\Models\Workorder::query() - ->with(['point','publisher']) + ->with(['point' => function($query) { + $query->withTrashed(); + },'publisher' => function($query) { + $query->withTrashed(); + }]) ->withCount(['items' => function($query) { $query->where('is_read', 0) ->where('point_id',Admin::user()->id) @@ -70,7 +74,9 @@ class WorkorderController extends AdminController } $workorderItem = WorkorderItem::query() - ->with(['publisher']) + ->with(['publisher' => function($query) { + $query->withTrashed(); + }]) ->where('workorder_id',$workorderId) ->get(); diff --git a/app/AdminSupplier/Controllers/WorkorderController.php b/app/AdminSupplier/Controllers/WorkorderController.php index 1023808..33b484e 100755 --- a/app/AdminSupplier/Controllers/WorkorderController.php +++ b/app/AdminSupplier/Controllers/WorkorderController.php @@ -34,7 +34,11 @@ class WorkorderController extends AdminController $userList = $msgList = []; $workorder = \App\Models\Workorder::query() - ->with(['point','publisher']) + ->with(['point' => function($query) { + $query->withTrashed(); + },'publisher' => function($query) { + $query->withTrashed(); + }]) ->withCount(['items' => function($query) { $query->where('is_read', 0) ->where('point_id',Admin::user()->id) @@ -69,7 +73,9 @@ class WorkorderController extends AdminController } $workorderItem = WorkorderItem::query() - ->with(['publisher']) + ->with(['publisher' => function($query) { + $query->withTrashed(); + }]) ->where('workorder_id',$workorderId) ->get();