From 71751241cc14f5bb1cd1af919eda03be9f4b825e Mon Sep 17 00:00:00 2001 From: lemon <15040771@qq.com> Date: Fri, 24 Sep 2021 14:54:41 +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/AdminSupplier/Controllers/WorkorderController.php | 6 +----- app/Models/Withdrawal.php | 4 ++-- app/Models/Workorder.php | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/AdminSupplier/Controllers/WorkorderController.php b/app/AdminSupplier/Controllers/WorkorderController.php index 33b484e..ae4afb3 100755 --- a/app/AdminSupplier/Controllers/WorkorderController.php +++ b/app/AdminSupplier/Controllers/WorkorderController.php @@ -34,11 +34,7 @@ class WorkorderController extends AdminController $userList = $msgList = []; $workorder = \App\Models\Workorder::query() - ->with(['point' => function($query) { - $query->withTrashed(); - },'publisher' => function($query) { - $query->withTrashed(); - }]) + ->with(['point','publisher']) ->withCount(['items' => function($query) { $query->where('is_read', 0) ->where('point_id',Admin::user()->id) diff --git a/app/Models/Withdrawal.php b/app/Models/Withdrawal.php index 22a06b9..97a6fbc 100755 --- a/app/Models/Withdrawal.php +++ b/app/Models/Withdrawal.php @@ -15,12 +15,12 @@ class Withdrawal extends Model public function pay() { - return $this->morphTo(); + return $this->morphTo()->withTrashed(); } public function user() { - return $this->morphTo(); + return $this->morphTo()->withTrashed(); } public function statement() diff --git a/app/Models/Workorder.php b/app/Models/Workorder.php index 47a7b65..39f6f95 100755 --- a/app/Models/Workorder.php +++ b/app/Models/Workorder.php @@ -15,12 +15,12 @@ class Workorder extends Model public function publisher() { - return $this->morphTo(); + return $this->morphTo()->withTrashed(); } public function point() { - return $this->morphTo(); + return $this->morphTo()->withTrashed(); } public function items()