作者 王晓刚
1 个管道 的构建 通过 耗费 0 秒

bug

... ... @@ -207,6 +207,10 @@ class GoodsdetailsController extends WeChatBaseController{
$ret['type'] = 20;
return json_encode($ret);
}
if(in_array(intval($my_user['status']),[1,5,6])){
$ret['type'] = 21;
return json_encode($ret);
}
$goods_id = $_POST['id'];
$data[] = Db::name('goods') -> where('id',$goods_id) -> find();
$data[0]['book_num'] = 1;
... ...
... ... @@ -201,10 +201,12 @@ class ShopcartController extends WeChatBaseController{
$uid = cmf_get_current_user_id();
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
if($my_user['status'] == 2){
return false;
if(in_array(intval($my_user['status']),[1,5,6])){
return 2;
}else if($my_user['status'] == 2){
return 0;
}else{
return true;
return 1;
}
}
... ...
... ... @@ -238,7 +238,11 @@
obj = JSON.parse(data);
if(obj.type == 20){
alert('业务员不能购买');
}if(obj.type == 3){
}
if(obj.type == 21){
alert('业务员申请中');
}
if(obj.type == 3){
alert('业务员商品和平台商品不能同时购买!');
}else if(obj.type == 1){
window.location.href = "{:url('Orderpage/order_page')}?indet_id="+obj.indet_id;
... ...
... ... @@ -144,7 +144,7 @@
alert('请选择商品');
}else{
$.post("{:url('Shopcart/is_to_pay')}",{},function(data){
if(data){
if(data == 1){
goods_id = goods_id.join(',');
myprice = $('#myprice').text();
$.post("{:url('Shopcart/shop_cart_pay')}",{id:goods_id,myprice:myprice},function(data){
... ... @@ -158,8 +158,10 @@
}
});
}else{
}else if(data == 0){
alert('业务员不能购买书籍');
}else{
alert('业务员审核中,不能购买书籍')
}
});
... ...