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()