作者 耿培杰

修改购物车递减接口

... ... @@ -237,6 +237,8 @@ class Car extends Api
if (empty($car_id)) $this->error('缺少参数 car_id!');
$where['user_id'] = $userId;
$where['id'] = $car_id;
$carInfo = $this->carModel->where('id',$car_id)->find();
if ($carInfo['number'] == 1) $this->error('不可以再减了');
$res = $this->carModel->where($where)->setDec('number',1);
if ($res) $this->success('SUCCESS');
... ...