mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Fixed #9680: Use Eloquent’s withCount
method to count Statuslabel assets
This commit is contained in:
parent
6c1dd81e0a
commit
4f6b1bb12d
|
@ -167,10 +167,7 @@ class StatuslabelsController extends Controller
|
||||||
{
|
{
|
||||||
$this->authorize('view', Statuslabel::class);
|
$this->authorize('view', Statuslabel::class);
|
||||||
|
|
||||||
$statuslabels = Statuslabel::with('assets')
|
$statuslabels = Statuslabel::withCount('assets')->get();
|
||||||
->groupBy('id')
|
|
||||||
->withCount('assets as assets_count')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
$labels=[];
|
$labels=[];
|
||||||
$points=[];
|
$points=[];
|
||||||
|
|
Loading…
Reference in a new issue