'1','info'=>'身份证号码有误')); // die; //} if(!$name||!$id_type){ echo json_encode(array('code'=>'1','info'=>'请填写完整信息')); die; } if($id){ $sql = "update wechat_customer set name = '".$name."',id_type = '".$id_type."', id_num = '".$id_num."' where id =".$_POST['id']; }else{ $sql = "insert into wechat_customer(`name`,`phone`,`id_type`,`id_num`,`wechat_user_id`,`wechat_open_id`)" . " values('".$name."','".$phone."','".$id_type."','".$id_num."','".$userid."','".$openid."')"; } //writeLog($sql_search); $rs = $pdo->query($sql); $rowset = $rs->fetchAll(PDO::FETCH_ASSOC); if($rowset){ echo json_encode(array('code'=>'0','info'=>'0')); }else{ echo json_encode(array('code'=>'0','info'=>'0')); }