Browse Source

软删除

master
lemon 4 years ago
parent
commit
71751241cc
  1. 6
      app/AdminSupplier/Controllers/WorkorderController.php
  2. 4
      app/Models/Withdrawal.php
  3. 4
      app/Models/Workorder.php

6
app/AdminSupplier/Controllers/WorkorderController.php

@ -34,11 +34,7 @@ class WorkorderController extends AdminController
$userList = $msgList = []; $userList = $msgList = [];
$workorder = \App\Models\Workorder::query() $workorder = \App\Models\Workorder::query()
->with(['point' => function($query) {
$query->withTrashed();
},'publisher' => function($query) {
$query->withTrashed();
}])
->with(['point','publisher'])
->withCount(['items' => function($query) { ->withCount(['items' => function($query) {
$query->where('is_read', 0) $query->where('is_read', 0)
->where('point_id',Admin::user()->id) ->where('point_id',Admin::user()->id)

4
app/Models/Withdrawal.php

@ -15,12 +15,12 @@ class Withdrawal extends Model
public function pay() public function pay()
{ {
return $this->morphTo();
return $this->morphTo()->withTrashed();
} }
public function user() public function user()
{ {
return $this->morphTo();
return $this->morphTo()->withTrashed();
} }
public function statement() public function statement()

4
app/Models/Workorder.php

@ -15,12 +15,12 @@ class Workorder extends Model
public function publisher() public function publisher()
{ {
return $this->morphTo();
return $this->morphTo()->withTrashed();
} }
public function point() public function point()
{ {
return $this->morphTo();
return $this->morphTo()->withTrashed();
} }
public function items() public function items()

Loading…
Cancel
Save