...
|
...
|
@@ -89,6 +89,9 @@ class ShopcartController extends WeChatBaseController{ |
|
|
$num = $this->request->param('num',0,'intval');
|
|
|
$data = Db::name('shopping_cart') -> where('id',$id) -> find();
|
|
|
if($data['book_num'] != $num){
|
|
|
if($num < 1){
|
|
|
$this->error('商品数量不能小于1');
|
|
|
}
|
|
|
if($num > 999){
|
|
|
$this->error('商品数量不能大于999');
|
|
|
}
|
...
|
...
|
@@ -108,7 +111,7 @@ class ShopcartController extends WeChatBaseController{ |
|
|
|
|
|
$id = $_POST['id'];
|
|
|
$data = Db::name('shopping_cart') -> where('id',$id) -> find();
|
|
|
if($data['book_num']<200){
|
|
|
if($data['book_num']<999){
|
|
|
$res = Db::name('shopping_cart') -> where('id',$id) -> setInc('book_num');
|
|
|
}
|
|
|
return true;
|
...
|
...
|
|