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

测试

... ... @@ -118,8 +118,9 @@ class AgentRegisterMobileController extends WeChatBaseController
$consent = $this->request->post('consent');
$card_id = $this->request->post('card_id');
$company = $this->request->post('company');
$site = $this->request->post('site');
$date = $this->request->post('date');
if(empty($name) || empty($mobile) || empty($code) || empty($card_id) || empty($company)){
if(empty($name) || empty($mobile) || empty($code) || empty($card_id) || empty($company) || empty($site)){
$arr['code'] = 40001;
$arr['msg'] = "缺少必要参数!";
return json_encode($arr);
... ... @@ -146,9 +147,9 @@ class AgentRegisterMobileController extends WeChatBaseController
//写入申请表中
$data = Db::name('application_agent')->where(array('delete_time'=>0,'user_id'=>$user_id))->find();
if(empty($data)){
Db::name('application_agent')->insert(array('user_id'=>$user_id,'status'=>1,'create_time'=>time(),'phone'=>$mobile,'date'=>$date,'card_id'=>$card_id,'company'=>$company,'name'=>$name));
Db::name('application_agent')->insert(array('user_id'=>$user_id,'status'=>1,'create_time'=>time(),'phone'=>$mobile,'date'=>$date,'card_id'=>$card_id,'company'=>$company,'name'=>$name,'site'=>$site));
}else{
Db::name('application_agent')->where('id',$data['id'])->update(array('user_id'=>$user_id,'status'=>1,'update_time'=>time(),'phone'=>$mobile,'date'=>$date,'card_id'=>$card_id,'company'=>$company,'name'=>$name));
Db::name('application_agent')->where('id',$data['id'])->update(array('user_id'=>$user_id,'status'=>1,'update_time'=>time(),'phone'=>$mobile,'date'=>$date,'card_id'=>$card_id,'company'=>$company,'name'=>$name,'site'=>$site));
}
$arr['code'] = 20000;
$arr['msg'] = "注册成功!";
... ...
... ... @@ -135,6 +135,7 @@
var code=$('#code').val();
var date=$('#date').text();
var company=$('#company').val();
var site=$('#start').val();
var sfid=$('#sfid').val();
if(name==''){
... ... @@ -147,6 +148,8 @@
toast("验证码不能为空")
}else if(date==''){
toast("出生日期不能为空")
}else if(site == ''){
toast("请选择所在地")
}else if(company==''){
toast("就职公司不能为空")
}else if(sfid==''){
... ... @@ -160,7 +163,7 @@
$.ajax({
url:"{:url('agent_register_mobile/register_mobile')}",
type:"POST",
data:{'phone':tel,'name':name,'code':code,'date':date,'company':company,'card_id':sfid,'consent':1},
data:{'phone':tel,'name':name,'code':code,'date':date,'company':company,'site':site,'card_id':sfid,'consent':1},
success:function(data){
var result = eval("(" + data + ")");
if(result.code == 40001){
... ...