|
- <?php
- /*
- Author:XM
- Compeny:Spiders Travel
- */
- require_once '../Common/Mysql.php';
- if (ALLOW_ORIGIN)
- header("Access-Control-Allow-Origin:*");
-
- $method=isset($_GET['method'])?(empty($_GET['method'])?'':$_GET['method']):'';
- $user_id=getUserId();
- if ($user_id ==false){
- echo json_encode(array("code"=>"-1","info"=>"用户未登录"));
- exit;
- }
- $order_id=isset($_GET['order_id'])?$_GET['order_id']:'';
- if($order_id==''){
- $data['code']="-1";
- $data['info']="缺少参数";
- echo json_encode($data);
- exit();
- }
- $pdo=conn();
- switch($method){
- case "getOrderChannel"://根据order_id得到订单渠道
- $sql="select
- A.ORG_ID as org_id,
- A.ORG_NAME as org_name,
- case A.ORG_ID when 0 then 176
- else 177
- end as org_type_id,
- B.OUTSIDE_ORDER_NO as outside_order_id,
- case A.ORG_ID when 0 then '自营'
- else '分销'
- end as org_type
- from base_organization as A inner join order_main as B on B.SALE_ORG_ID=A.ORG_ID
- where B.ORDER_ID=".$order_id." and B.CANCEL_FLAG=0 and B.ORDER_VALID_STATUS=1;
- ;";
- if(is_object($pdo)){
- $result=$pdo->query($sql);
- $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
- $data['code']="0";
- $data['info']="";
- $data['order_channel']=$rowset;
- }
- break;
- default:
- break;
- }
- if(is_array($data)){
- echo json_encode($data);
- }
-
-
- exit();
- ?>
|