|
|
@ -35,6 +35,11 @@ class WorkorderController extends AdminController |
|
|
|
|
|
|
|
|
$workorder = \App\Models\Workorder::query() |
|
|
$workorder = \App\Models\Workorder::query() |
|
|
->with(['point','publisher']) |
|
|
->with(['point','publisher']) |
|
|
|
|
|
->withCount(['items' => function($query) { |
|
|
|
|
|
$query->where('is_read', 0) |
|
|
|
|
|
->where('point_id',Admin::user()->id) |
|
|
|
|
|
->where('point_type',DemandTraits::$col[1]); |
|
|
|
|
|
}]) |
|
|
->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[1]]) |
|
|
->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[1]]) |
|
|
->orWhere(function ($query) { |
|
|
->orWhere(function ($query) { |
|
|
$query->where('point_id',Admin::user()->id) |
|
|
$query->where('point_id',Admin::user()->id) |
|
|
|