You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.2 KiB

  1. <?php
  2. header("Access-Control-Allow-Origin:*");
  3. $post = $_POST;
  4. $password = md5("Zzcx8888");
  5. $time = date("Y-m-d H:i:s",time());
  6. $sql = "update base_user set USER_NAME = $post[login_name],CREATE_TIME = '$time',PHONE_NO = $post[bound_tel] where id = $post[user_id]";
  7. $result = $pdo ->exec($sql);
  8. if($result){
  9. $sql = "select ID from base_user where CREATE_TIME = '$time'";
  10. $result=$pdo->query($sql);
  11. if($result){
  12. $arr = $result->fetchAll(PDO::FETCH_ASSOC);
  13. $id = $arr[0]['ID'];
  14. $sql = "update base_customer set USER_ID = $id where CUST_ID = $post[id]";
  15. $result=$pdo->exec($sql);
  16. if($result){
  17. $code = 0;
  18. $info = 'success';
  19. $massge = '成功';
  20. }else{
  21. $code = -1;
  22. $info = 'fail';
  23. $massge = '失败';
  24. }
  25. }else{
  26. $code = -1;
  27. $info = 'fail';
  28. $massge = '失败';
  29. }
  30. }else{
  31. $code = -1;
  32. $info = 'fail';
  33. $massge = '失败';
  34. }
  35. $json['code'] = $code;
  36. $json['info'] = $info;
  37. $json['massge'] = $massge;
  38. echo json_encode($json);
  39. ?>