mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -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'),
|
'note' => $request->input('note'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$checkedout=DB::table('accessories_users')->where('accessory_id', '=', $accessory->id)->count();
|
|
||||||
$available= new Accessory();
|
$available= new Accessory();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($checkedout >= $available->numRemaining()){
|
if($available->numRemaining()<=0){
|
||||||
|
|
||||||
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkout.unavailable'));
|
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkout.unavailable'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue