mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
removed an unncessary query
This commit is contained in:
parent
55943d8897
commit
3d7c55deb3
|
@ -77,12 +77,11 @@ class AccessoryCheckoutController extends Controller
|
|||
'note' => $request->input('note'),
|
||||
]);
|
||||
|
||||
$checkedout=DB::table('accessories_users')->where('accessory_id', '=', $accessory->id)->count();
|
||||
$available= new Accessory();
|
||||
|
||||
|
||||
|
||||
if($checkedout >= $available->numRemaining()){
|
||||
if($available->numRemaining()<=0){
|
||||
|
||||
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkout.unavailable'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue