mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -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);
|
||||
|
||||
$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