|
- <?php
- header("Access-Control-Allow-Origin:*");
- $post = $_POST;
- $password = md5("Zzcx8888");
- $time = date("Y-m-d H:i:s",time());
- $sql = "update base_user set USER_NAME = $post[login_name],CREATE_TIME = '$time',PHONE_NO = $post[bound_tel] where id = $post[user_id]";
-
- $result = $pdo ->exec($sql);
- if($result){
- $sql = "select ID from base_user where CREATE_TIME = '$time'";
- $result=$pdo->query($sql);
- if($result){
- $arr = $result->fetchAll(PDO::FETCH_ASSOC);
- $id = $arr[0]['ID'];
- $sql = "update base_customer set USER_ID = $id where CUST_ID = $post[id]";
- $result=$pdo->exec($sql);
- if($result){
- $code = 0;
- $info = 'success';
- $massge = '成功';
- }else{
- $code = -1;
- $info = 'fail';
- $massge = '失败';
- }
- }else{
- $code = -1;
- $info = 'fail';
- $massge = '失败';
- }
- }else{
- $code = -1;
- $info = 'fail';
- $massge = '失败';
- }
- $json['code'] = $code;
- $json['info'] = $info;
- $json['massge'] = $massge;
- echo json_encode($json);
- ?>
|