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.
 
 
 
 

78 rivejä
2.4 KiB

  1. <?php
  2. require_once 'dictionary.php';
  3. header("Access-Control-Allow-Origin:*");
  4. $post = $_POST;
  5. $sql = "select CREATE_USER_ID,ORDER_PAY_STATUS from order_main where ID = $post[order_id]";
  6. $result1=$pdo->query($sql);
  7. $list3 = $result1->fetchAll(PDO::FETCH_ASSOC);
  8. $list3 = $list3[0];
  9. //获取order_commission表重要信息
  10. $sql = "select PAY_TYPE_ID,APPLY_TIME from order_commission where ORDER_ID = $post[order_id]";
  11. $result=$pdo->query($sql);
  12. if($result){
  13. $list = $result->fetchAll(PDO::FETCH_ASSOC);
  14. $list = $list[0];
  15. $list['id'] = $list3['CREATE_USER_ID'];
  16. $list['pay_status'] = ($list3['ORDER_PAY_STATUS'] == '0')?"未结":"已结";
  17. $list['apply_time'] = ($list3['ORDER_PAY_STATUS'] == '0')?"-":$list['APPLY_TIME'];
  18. //获取base_customer表重要信息
  19. $sql = "select CHAN_QUALITY,SELA_TYPE,CHAN_NAME from base_customer where USER_ID = $list[id]";
  20. $result=$pdo->query($sql);
  21. if($result){
  22. $list1 = $result->fetchAll(PDO::FETCH_ASSOC);
  23. $list1 = $list1[0];
  24. foreach($list1 as $k => $v){
  25. if(array_key_exists($k,$coutomer)){
  26. $list1[$k] = $coutomer[$k][$v];
  27. }
  28. }
  29. $list['sale_type'] = $list1['SELA_TYPE']."(".$list1['CHAN_QUALITY']."-".$list1['CHAN_NAME'].")";
  30. //获取支付方式
  31. $sql = "select TYPE_NAME from dict_type where ID = $list[PAY_TYPE_ID]";
  32. $result=$pdo->query($sql);
  33. if($result){
  34. $list2 = $result->fetchAll(PDO::FETCH_ASSOC);
  35. $list2 = $list2[0];
  36. unset($list['PAY_TYPE_ID']);unset($list['APPLY_TIME']);
  37. $list['pay_type'] = $list2['TYPE_NAME'];
  38. $code = 0;
  39. $info = 'success';
  40. $massge = '成功';
  41. }else{
  42. $code = -3;
  43. $info = 'fail';
  44. $massge = '失败';
  45. $list = '';
  46. }
  47. }else{
  48. $code = -2;
  49. $info = 'fail';
  50. $massge = '失败';
  51. $list = '';
  52. }
  53. }else{
  54. $code = -1;
  55. $info = 'fail';
  56. $massge = '失败';
  57. $list = '';
  58. }
  59. $json['code'] = $code;
  60. $json['info'] = $info;
  61. $json['massge'] = $massge;
  62. $json['list'] = $list;
  63. //print_r($json);
  64. echo json_encode($json);
  65. ?>