Browse Source

fix统计

develop
shuixiang 4 years ago
parent
commit
4645d3f507
  1. 4
      app/AdminAgent/Controllers/WorkorderController.php
  2. 4
      app/AdminGuide/Controllers/WorkorderController.php
  3. 5
      app/AdminSupplier/Controllers/WorkorderController.php

4
app/AdminAgent/Controllers/WorkorderController.php

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

4
app/AdminGuide/Controllers/WorkorderController.php

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

5
app/AdminSupplier/Controllers/WorkorderController.php

@ -35,6 +35,11 @@ class WorkorderController extends AdminController
$workorder = \App\Models\Workorder::query()
->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]])
->orWhere(function ($query) {
$query->where('point_id',Admin::user()->id)

Loading…
Cancel
Save