mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
4d8569e754
|
@ -8,6 +8,7 @@ use App\Http\Transformers\AssetsTransformer;
|
||||||
use App\Http\Transformers\SelectlistTransformer;
|
use App\Http\Transformers\SelectlistTransformer;
|
||||||
use App\Http\Transformers\StatuslabelsTransformer;
|
use App\Http\Transformers\StatuslabelsTransformer;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
|
use App\Models\Setting;
|
||||||
use App\Models\Statuslabel;
|
use App\Models\Statuslabel;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Transformers\PieChartTransformer;
|
use App\Http\Transformers\PieChartTransformer;
|
||||||
|
@ -187,8 +188,14 @@ class StatuslabelsController extends Controller
|
||||||
public function getAssetCountByStatuslabel() : array
|
public function getAssetCountByStatuslabel() : array
|
||||||
{
|
{
|
||||||
$this->authorize('view', Statuslabel::class);
|
$this->authorize('view', Statuslabel::class);
|
||||||
|
|
||||||
|
if (Setting::getSettings()->show_archived_in_list == 0 ) {
|
||||||
|
$statuslabels = Statuslabel::withCount('assets')->where('archived','0')->get();
|
||||||
|
} else {
|
||||||
$statuslabels = Statuslabel::withCount('assets')->get();
|
$statuslabels = Statuslabel::withCount('assets')->get();
|
||||||
$total = Array();
|
}
|
||||||
|
|
||||||
|
$total = [];
|
||||||
|
|
||||||
foreach ($statuslabels as $statuslabel) {
|
foreach ($statuslabels as $statuslabel) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue