mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Merge pull request #9681 from tulsaschoolsdata/9680-fix-statuslabels-asset-count
Fixed #9680: Use Eloquent’s `withCount` method to count Statuslabel assets
This commit is contained in:
commit
c801305c9b
|
@ -167,10 +167,7 @@ class StatuslabelsController extends Controller
|
|||
{
|
||||
$this->authorize('view', Statuslabel::class);
|
||||
|
||||
$statuslabels = Statuslabel::with('assets')
|
||||
->groupBy('id')
|
||||
->withCount('assets as assets_count')
|
||||
->get();
|
||||
$statuslabels = Statuslabel::withCount('assets')->get();
|
||||
|
||||
$labels=[];
|
||||
$points=[];
|
||||
|
|
Loading…
Reference in a new issue