正在显示
1 个修改的文件
包含
2 行增加
和
0 行删除
@@ -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'); |
-
请 注册 或 登录 后发表评论