Merge pull request '可在租车辆取值为负数修复' (#89) from zhangwei into dev
Reviewed-on: #89
This commit is contained in:
commit
bb46321da0
@ -30,7 +30,7 @@ class VehicleController extends BaseApiController
|
|||||||
//自有车辆数量
|
//自有车辆数量
|
||||||
$selfCar = VehicleRent::field('id')->where('company_id',$this->userInfo['company_id'])->where('status','<>',3)->where('type',1)->count();
|
$selfCar = VehicleRent::field('id')->where('company_id',$this->userInfo['company_id'])->where('status','<>',3)->where('type',1)->count();
|
||||||
//可在租车辆
|
//可在租车辆
|
||||||
$doubleRentCar = $villageCompany - $rentCar - $applyCar - $selfCar;
|
$doubleRentCar = max($villageCompany - $rentCar - $applyCar - $selfCar,0);
|
||||||
if($params['num'] > $doubleRentCar ){
|
if($params['num'] > $doubleRentCar ){
|
||||||
return $this->fail('数量超过可再租车辆数');
|
return $this->fail('数量超过可再租车辆数');
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ class VehicleController extends BaseApiController
|
|||||||
//自有车辆数量
|
//自有车辆数量
|
||||||
$selfCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('status','<>',3)->where('type',1)->count();
|
$selfCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('status','<>',3)->where('type',1)->count();
|
||||||
//可在租车辆
|
//可在租车辆
|
||||||
$doubleRentCar = $villageCompany - $rentCar - $applyCar - $selfCar;
|
$doubleRentCar = max($villageCompany - $rentCar - $applyCar - $selfCar,0);
|
||||||
//设置数据
|
//设置数据
|
||||||
$data = [
|
$data = [
|
||||||
'apply' => $vehicleContract,
|
'apply' => $vehicleContract,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user