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

4

... ... @@ -244,10 +244,9 @@ class OrderpageController extends WeChatBaseController{
public function salesman_ty_go_pay(){
$_POST['is_courier'] = 1;
$school_class = explode(' ',$_POST['school_class']);
$_POST['school'] = $school_class[0];
$_POST['grade'] = $school_class[1];
$_POST['class'] = $school_class[3];
$class = explode('-',$_POST['grade']);
$_POST['grade'] = trim($class[0]);
$_POST['class'] = trim($class[1]);
$indent_data['id'] = $_POST['id'];
$indent_data['region'] = $_POST['region'];
$indent_data['name'] = $_POST['name'];
... ... @@ -310,7 +309,12 @@ class OrderpageController extends WeChatBaseController{
$datas[$key]['value'] = $val['id'];
$datas[$key]['text'] = $val['school'];
}
return json_encode($datas);
if(!empty($datas)){
return json_encode($datas);
}else{
return false;
}
// $this->success('SUCCESS','',$datas);
}
... ...
... ... @@ -314,13 +314,17 @@
$.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
if(data){
region = $('#city_text').text();
school_class = $('#school_class').text();
// school_class = $('#school_class').text();
school = $('.xuexiao_name').text();
grade = $('.banji_name').text();
name = $('#name').val();
phone = $('#phone').val();
if(region == '请选择省市区'){
alert('地区不能为空');
}else if(school_class == '请选择学校和班级'){
alert('学校班级不能为空');
}else if(school == '请选择学校'){
alert('学校不能为空');
}else if(grade == '请选择班级'){
alert('班级不能为空');
}else if(name == ''){
alert('姓名不能为空');
}else if(phone == ''){
... ... @@ -329,7 +333,7 @@
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){
$.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school:school,name:name,phone:phone,grade:grade},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
}else{
... ... @@ -371,10 +375,19 @@
var area = items[0].text+" "+items[1].text+" "+items[2].text;
$.get("{:url('get_school')}",{'area':area},function(res){
console.log(res);
myschool = JSON.parse(res);
console.log(myschool);
school_s(myschool);
$('.xuexiao_name').text('请选择学校');
$('.xuexiao_name').removeAttr("style");
$('.banji_name').text('请选择班级');
$('.banji_name').removeAttr("style");
if(res){
myschool = JSON.parse(res);
console.log(myschool);
school_s(myschool);
}else{
school_s('');
grade_s('');
}
});
});
}, 200);
... ...
... ... @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
/*$user = Db::name('user')->where('id',6)->find();
/*$user = Db::name('user')->where('id',13)->find();
cmf_update_current_user($user);*/
$userId = cmf_get_current_user_id();
if (empty($userId)) {
... ...