mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Use object count instead of php count
This commit is contained in:
parent
54b5a47847
commit
ffa43d2a36
|
@ -392,9 +392,10 @@ class UsersController extends Controller
|
|||
return redirect()->route('users.index')->with('error', 'This user still has ' . $user->assets()->count() . ' assets associated with them.');
|
||||
}
|
||||
|
||||
if ($user->assets->count() > 0) {
|
||||
|
||||
if ($user->assets->count() > 0) {
|
||||
// Redirect to the user management page
|
||||
return redirect()->route('users.index')->with('error', 'This user still has ' . count($user->assets->count()) . ' assets associated with them.');
|
||||
return redirect()->route('users.index')->with('error', 'This user still has ' . $user->assets->count() . ' assets associated with them.');
|
||||
}
|
||||
|
||||
if ($user->licenses()->count() > 0) {
|
||||
|
@ -465,8 +466,9 @@ class UsersController extends Controller
|
|||
{
|
||||
$this->authorize('update', User::class);
|
||||
|
||||
if (($request->has('ids')) && (count($request->input('ids')) > 0)) {
|
||||
|
||||
if ((!$request->filled('ids')) || (count($request->input('ids')) == 0)) {
|
||||
return redirect()->back()->with('error', 'No users selected');
|
||||
} else {
|
||||
$user_raw_array = $request->input('ids');
|
||||
$update_array = array();
|
||||
$manager_conflict = false;
|
||||
|
|
Loading…
Reference in a new issue