作者 耿培杰

修改购物车递减接口

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