作者 anyv
1 个管道 的构建 通过 耗费 4 秒

4

... ... @@ -149,11 +149,7 @@ class OrderpageController extends WeChatBaseController{
$_POST['is_courier'] = 2;
$data_update = Db::name('indent') -> update($_POST);
if($data_update){
return true;
}else{
return false;
}
return true;
}
... ... @@ -178,11 +174,7 @@ class OrderpageController extends WeChatBaseController{
public function goods_leave_word_update(){
$data = Db::name('indent') -> update($_POST);
if($data){
return true;
}else{
return false;
}
return true;
}
... ...
... ... @@ -190,6 +190,20 @@ class ShopcartController extends WeChatBaseController{
}
/**
* 业务员不能买书
*/
public function is_to_pay(){
$uid = cmf_get_current_user_id();
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
if($my_user['status'] == 2){
return false;
}else{
return true;
}
}
... ...
... ... @@ -140,20 +140,27 @@
if(goods_id.length == 0){
alert('不能为空');
}else{
goods_id = goods_id.join(',');
myprice = $('#myprice').text();
$.post("{:url('Shopcart/shop_cart_pay')}",{id:goods_id,myprice:myprice},function(data){
obj = JSON.parse(data);
if(obj.type == 3){
alert('业务员商品和平台商品不能同时购买!');
}else if(obj.type == 1){
window.location.href = "{:url('Orderpage/order_page')}?indet_id="+obj.indet_id;
}else if(obj.type == 2){
window.location.href = "{:url('Orderpage/order_salesman_ty')}?indet_id="+obj.indet_id;
}
$.post("{:url('Shopcart/is_to_pay')}",{},function(data){
if(data){
goods_id = goods_id.join(',');
myprice = $('#myprice').text();
$.post("{:url('Shopcart/shop_cart_pay')}",{id:goods_id,myprice:myprice},function(data){
obj = JSON.parse(data);
if(obj.type == 3){
alert('业务员商品和平台商品不能同时购买!');
}else if(obj.type == 1){
window.location.href = "{:url('Orderpage/order_page')}?indet_id="+obj.indet_id;
}else if(obj.type == 2){
window.location.href = "{:url('Orderpage/order_salesman_ty')}?indet_id="+obj.indet_id;
}
});
}else{
alert('业务员不能购买书籍');
}
});
}
}
... ...
... ... @@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
$user = Db::name('user')->where('id',2)->find();
cmf_update_current_user($user);
/*$user = Db::name('user')->where('id',2)->find();
cmf_update_current_user($user);*/
$userId = cmf_get_current_user_id();
if (empty($userId)) {
$config = [
... ...