|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- require_once 'dictionary.php';
- header("Access-Control-Allow-Origin:*");
- $post = $_POST;
-
- $sql = "select CREATE_USER_ID,ORDER_PAY_STATUS from order_main where ID = $post[order_id]";
- $result1=$pdo->query($sql);
- $list3 = $result1->fetchAll(PDO::FETCH_ASSOC);
- $list3 = $list3[0];
-
- //获取order_commission表重要信息
- $sql = "select PAY_TYPE_ID,APPLY_TIME from order_commission where ORDER_ID = $post[order_id]";
- $result=$pdo->query($sql);
-
-
- if($result){
- $list = $result->fetchAll(PDO::FETCH_ASSOC);
- $list = $list[0];
-
- $list['id'] = $list3['CREATE_USER_ID'];
- $list['pay_status'] = ($list3['ORDER_PAY_STATUS'] == '0')?"未结":"已结";
- $list['apply_time'] = ($list3['ORDER_PAY_STATUS'] == '0')?"-":$list['APPLY_TIME'];
-
- //获取base_customer表重要信息
- $sql = "select CHAN_QUALITY,SELA_TYPE,CHAN_NAME from base_customer where USER_ID = $list[id]";
- $result=$pdo->query($sql);
- if($result){
- $list1 = $result->fetchAll(PDO::FETCH_ASSOC);
- $list1 = $list1[0];
- foreach($list1 as $k => $v){
- if(array_key_exists($k,$coutomer)){
- $list1[$k] = $coutomer[$k][$v];
- }
- }
-
- $list['sale_type'] = $list1['SELA_TYPE']."(".$list1['CHAN_QUALITY']."-".$list1['CHAN_NAME'].")";
-
- //获取支付方式
- $sql = "select TYPE_NAME from dict_type where ID = $list[PAY_TYPE_ID]";
- $result=$pdo->query($sql);
- if($result){
- $list2 = $result->fetchAll(PDO::FETCH_ASSOC);
- $list2 = $list2[0];
-
- unset($list['PAY_TYPE_ID']);unset($list['APPLY_TIME']);
- $list['pay_type'] = $list2['TYPE_NAME'];
- $code = 0;
- $info = 'success';
- $massge = '成功';
-
- }else{
- $code = -3;
- $info = 'fail';
- $massge = '失败';
- $list = '';
- }
-
- }else{
- $code = -2;
- $info = 'fail';
- $massge = '失败';
- $list = '';
- }
- }else{
- $code = -1;
- $info = 'fail';
- $massge = '失败';
- $list = '';
- }
-
- $json['code'] = $code;
- $json['info'] = $info;
- $json['massge'] = $massge;
- $json['list'] = $list;
- //print_r($json);
- echo json_encode($json);
-
- ?>
|