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

1

... ... @@ -393,20 +393,20 @@ class SalesmanController extends AdminBaseController{
$id = $_POST['id'];
//删除老师购物车 浏览记录 收藏 订单待付款信息
$teacher = Db::name('my_user') -> where('id',$id) -> find();
Db::name('shopping_cart') -> where('uid',$teacher['uid']) -> delete();
//$teacher = Db::name('my_user') -> where('id',$id) -> find();
/*Db::name('shopping_cart') -> where('uid',$teacher['uid']) -> delete();
Db::name('browsing_history') -> where('uid',$teacher['uid']) -> delete();
Db::name('collect') -> where('uid',$teacher['uid']) -> delete();
Db::name('indent') -> where("uid=".$teacher['uid']." and state=4") -> delete();
Db::name('indent') -> where("uid=".$teacher['uid']." and state=4") -> delete();*/
//获取这个老师下的所有学生信息
$student = Db::name('my_user') -> where('pid',$id) -> select();
//$student = Db::name('my_user') -> where('pid',$id) -> select();
//循环删除学生的购物车 浏览记录 收藏 订单待付款信息
foreach ($student as $key => $val){
/*foreach ($student as $key => $val){
Db::name('shopping_cart') -> where('uid',$val['uid']) -> delete();
Db::name('browsing_history') -> where('uid',$val['uid']) -> delete();
Db::name('collect') -> where('uid',$val['uid']) -> delete();
Db::name('indent') -> where("uid=".$val['uid']." and state=4") -> delete();
}
}*/
//改变老师的身份状态
$data = Db::name('my_user') -> where('id',$id) -> update(['status'=>0,'pid'=>0,'is_pro'=>0,'bind_status'=>0,'is_withdrawal'=>1]);
//改变学生的身份状态
... ...
... ... @@ -141,7 +141,6 @@ class OrderController extends WeChatBaseController
}
return true;
}
//获取当前用户身份
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
//判断用户身份 获取上级业务员
... ...
... ... @@ -122,27 +122,36 @@
*点击去支付
*/
function go_pay(){
name = $('#name').text();
phone = $('#phone').text();
detailed = $('#detailed').text();
if(name == ''){
alert('收货地址不能为空');
}else if(phone == ''){
alert('收货地址不能为空');
}else if(detailed == ''){
alert('收货地址不能为空');
}else{
id = {$indent_id};
liuyan = $('#liuyan').val();
$.post("{:url('Orderpage/goods_leave_word_update')}",{id:id,leave_word:liuyan},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
indnet_id = "{$indent_id}";
$.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
if(data){
name = $('#name').text();
phone = $('#phone').text();
detailed = $('#detailed').text();
if(name == ''){
alert('收货地址不能为空');
}else if(phone == ''){
alert('收货地址不能为空');
}else if(detailed == ''){
alert('收货地址不能为空');
}else{
alert('订单更新失败!');
id = {$indent_id};
liuyan = $('#liuyan').val();
$.post("{:url('Orderpage/goods_leave_word_update')}",{id:id,leave_word:liuyan},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
}else{
alert('订单更新失败!');
}
});
}
});
}else{
alert('不再此区域销售');
}
});
}
}
/**
... ...
... ... @@ -139,27 +139,35 @@
*点击去支付
*/
function go_pay(){
name = $('#name').text();
phone = $('#phone').text();
detailed = $('#detailed').text();
if(name == ''){
alert('收货地址不能为空');
}else if(phone == ''){
alert('收货地址不能为空');
}else if(detailed == ''){
alert('收货地址不能为空');
}else{
liuyan = $('#liuyan').val();
indet_id = {$indet_id};
money = $('#money').text();
$.post("{:url('Orderpage/salesman_go_pay')}",{leave_word:liuyan,id:indet_id,money:money},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indet_id))}";
indnet_id = "{$indent_id}";
$.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
if(data){
name = $('#name').text();
phone = $('#phone').text();
detailed = $('#detailed').text();
if(name == ''){
alert('收货地址不能为空');
}else if(phone == ''){
alert('收货地址不能为空');
}else if(detailed == ''){
alert('收货地址不能为空');
}else{
alert('更新订单失败');
liuyan = $('#liuyan').val();
indet_id = {$indet_id};
money = $('#money').text();
$.post("{:url('Orderpage/salesman_go_pay')}",{leave_word:liuyan,id:indet_id,money:money},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indet_id))}";
}else{
alert('更新订单失败');
}
});
}
});
}
}else{
alert('不再此区域销售');
}
});
}
/**
... ...
... ... @@ -232,30 +232,38 @@
*点击去支付
*/
function go_pay(){
region = $('#city_text').text();
school_class = $('#school_class').text();
name = $('#name').val();
phone = $('#phone').val();
if(region == '请选择省市区'){
alert('地区不能为空');
}else if(school_class == '请选择学校和班级'){
alert('学校班级不能为空');
}else if(name == ''){
alert('姓名不能为空');
}else if(phone == ''){
alert('手机号不能为空');
}else{
liuyan = $('#liuyan').val();
indet_id = {$indent_id};
money = {$money.0};
$.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school_class:school_class,name:name,phone:phone},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
indnet_id = "{$indent_id}";
$.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
if(data){
region = $('#city_text').text();
school_class = $('#school_class').text();
name = $('#name').val();
phone = $('#phone').val();
if(region == '请选择省市区'){
alert('地区不能为空');
}else if(school_class == '请选择学校和班级'){
alert('学校班级不能为空');
}else if(name == ''){
alert('姓名不能为空');
}else if(phone == ''){
alert('手机号不能为空');
}else{
alert('更新订单失败');
liuyan = $('#liuyan').val();
indet_id = {$indent_id};
money = {$money.0};
$.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school_class:school_class,name:name,phone:phone},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
}else{
alert('更新订单失败');
}
});
}
});
}
}else{
alert('不再此区域销售');
}
});
}
... ...