mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 23:54:12 -08:00
Merge branch 'develop'
This commit is contained in:
commit
d379c6b61f
|
@ -161,19 +161,22 @@ class StatuslabelsController extends Controller
|
|||
public function getAssetCountByStatuslabel()
|
||||
{
|
||||
|
||||
$statusLabels = Statuslabel::get();
|
||||
$statuslabels = Statuslabel::with('assets')->groupBy('id')->withCount('assets')->get();
|
||||
|
||||
$labels=[];
|
||||
$points=[];
|
||||
$colors=[];
|
||||
foreach ($statusLabels as $statusLabel) {
|
||||
if ($statusLabel->assets()->count() > 0) {
|
||||
$labels[]=$statusLabel->name;
|
||||
$points[]=$statusLabel->assets()->whereNull('assigned_to')->count();
|
||||
if ($statusLabel->color!='') {
|
||||
$colors[]=$statusLabel->color;
|
||||
foreach ($statuslabels as $statuslabel) {
|
||||
if ($statuslabel->assets_count > 0) {
|
||||
|
||||
$labels[]=$statuslabel->name. ' ('.number_format($statuslabel->assets_count).')';
|
||||
$points[]=$statuslabel->assets_count;
|
||||
if ($statuslabel->color!='') {
|
||||
$colors[]=$statuslabel->color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$colors_array = array_merge($colors, Helper::chartColors());
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ class ManufacturersController extends Controller
|
|||
$image = $request->file('image');
|
||||
$file_name = str_slug($image->getClientOriginalName()).".".$image->getClientOriginalExtension();
|
||||
$path = public_path('uploads/manufacturers/'.$file_name);
|
||||
$old_image = $path.$model->image;
|
||||
$old_image = $path.$manufacturer->image;
|
||||
|
||||
try {
|
||||
unlink($old_image);
|
||||
|
|
Loading…
Reference in a new issue