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.
 
 
 
 

58 lines
1.3 KiB

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. require_once '../Common/Mysql.php';
  7. if (ALLOW_ORIGIN)
  8. header("Access-Control-Allow-Origin:*");
  9. $method=isset($_GET['method'])?(empty($_GET['method'])?'':$_GET['method']):'';
  10. $user_id=getUserId();
  11. if ($user_id ==false){
  12. echo json_encode(array("code"=>"-1","info"=>"用户未登录"));
  13. exit;
  14. }
  15. $order_id=isset($_GET['order_id'])?$_GET['order_id']:'';
  16. if($order_id==''){
  17. $data['code']="-1";
  18. $data['info']="缺少参数";
  19. echo json_encode($data);
  20. exit();
  21. }
  22. $pdo=conn();
  23. switch($method){
  24. case "getOrderChannel"://根据order_id得到订单渠道
  25. $sql="select
  26. A.ORG_ID as org_id,
  27. A.ORG_NAME as org_name,
  28. case A.ORG_ID when 0 then 176
  29. else 177
  30. end as org_type_id,
  31. B.OUTSIDE_ORDER_NO as outside_order_id,
  32. case A.ORG_ID when 0 then '自营'
  33. else '分销'
  34. end as org_type
  35. from base_organization as A inner join order_main as B on B.SALE_ORG_ID=A.ORG_ID
  36. where B.ORDER_ID=".$order_id." and B.CANCEL_FLAG=0 and B.ORDER_VALID_STATUS=1;
  37. ;";
  38. if(is_object($pdo)){
  39. $result=$pdo->query($sql);
  40. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  41. $data['code']="0";
  42. $data['info']="";
  43. $data['order_channel']=$rowset;
  44. }
  45. break;
  46. default:
  47. break;
  48. }
  49. if(is_array($data)){
  50. echo json_encode($data);
  51. }
  52. exit();
  53. ?>