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.
 
 
 
 

152 lines
5.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'])?$_GET['method']:'';
  10. $pdo=conn();
  11. switch ($method){
  12. case 'getRunInfo' :
  13. $USER_ID=isset($_GET['user_id'])?$_GET['user_id']:'';
  14. $RUN_ID=isset($_GET['run_id'])?$_GET['run_id']:'';
  15. $data=httpRequest('http://'.CS1_DOMAIN.'/api/run-edit/get-run-info',array('user_id'=>$USER_ID,'run_id'=>$RUN_ID));
  16. // $sql1="CALL SP_GET_RUN_LINE_INFO('".$USER_ID."','".$RUN_ID."')";
  17. // $sql2="CALL SP_GET_RUN_STATION('".$USER_ID."','".$RUN_ID."')";
  18. // $sql3="CALL XM_PRO_GET_LINE_CAR_TYPE('".$USER_ID."','".$RUN_ID."')";
  19. // $sql4="CALL SP_GET_RUN_HAS_CAR('".$USER_ID."','".$RUN_ID."')";
  20. // $sql5="CALL SP_GET_RUN_TICKETS_TYPE('".$USER_ID."','".$RUN_ID."')";
  21. // $sql6="CALL SP_GET_RUN_START_DATE('".$USER_ID."','".$RUN_ID."')";
  22. // if(is_object($pdo)){
  23. // $result1=$pdo->query($sql1);
  24. // $json1=$result1->fetchAll(PDO::FETCH_ASSOC);
  25. // $result1->closeCursor();
  26. //
  27. // $result2=$pdo->query($sql2);
  28. // $json2=$result2->fetchAll(PDO::FETCH_ASSOC);
  29. // $result2->closeCursor();
  30. //
  31. // $result3=$pdo->query($sql3);
  32. // $json3=$result3->fetchAll(PDO::FETCH_ASSOC);
  33. // $result3->closeCursor();
  34. //
  35. // $result4=$pdo->query($sql4);
  36. // $json4=$result4->fetchAll(PDO::FETCH_ASSOC);
  37. // $result4->closeCursor();
  38. //
  39. // $result5=$pdo->query($sql5);
  40. // $json5=$result5->fetchAll(PDO::FETCH_ASSOC);
  41. // $result5->closeCursor();
  42. //
  43. // $result6=$pdo->query($sql6);
  44. // $json6=$result6->fetchAll(PDO::FETCH_ASSOC);
  45. // $result6->closeCursor();
  46. // }
  47. // $data = array();
  48. // if(count($json1)>0){
  49. // $data["line"] = array("name" => $json1[0]['name'], "lineid" => $json1[0]['lineid']);
  50. // $data['sellday']= $json1[0]['pre_sale_day'];
  51. // $data['time']= $json6[0]["time"];
  52. // $data['station']=array();
  53. // foreach( $json2 as $temp_info ) {
  54. // $ticket_gate_ary = explode( ",", $temp_info["TICKET_GATE"]);
  55. // if( strpos($temp_info["TICKET_GATE"], ":") != false && count($ticket_gate_ary) > 0 ) {
  56. // $ticket_gate = array();
  57. // foreach ($ticket_gate_ary as $ticket_simple) {
  58. // $ticket_info = explode(":",$ticket_simple);
  59. // $ticket_gate[] = array( $ticket_info[0] => $ticket_info[1]);
  60. // }
  61. // } else {
  62. // $ticket_gate = "";
  63. // }
  64. // $temp_info_insert = $temp_info;
  65. // $temp_info_insert["TICKET_GATE"] = $ticket_gate;
  66. // $data['station'][] = $temp_info_insert;
  67. // }
  68. // }
  69. //
  70. // if(count($json3)>0){
  71. // $data['cartype']=$json3;
  72. // }
  73. //
  74. // if(count($json4)>0){
  75. // $data['hascar']=$json4;
  76. // }
  77. // if(count($json5)>0){
  78. // $data['ticket']=$json5;
  79. // }
  80. // $sql11 = "select
  81. // s.id as supplier_id,s.supplier_name as bus_team
  82. // from
  83. // base_supplier as s,base_supplier_purchase as p
  84. // where
  85. // s.id = p.supplier_id
  86. // and s.cancel_flag = 0
  87. // and s.supplier_type = 187
  88. // and p.cancel_flag = 0
  89. // and p.product_type = 259
  90. // group by s.id";
  91. // $result11 = $pdo->query($sql11);
  92. // $json11 = $result11->fetchAll(PDO::FETCH_ASSOC);
  93. // $data['supplier_list']=$json11;
  94. // $data['cost_type']=array(array('type_id' => 477, 'type_name' => '包车计价'), array('type_id' => 478, 'type_name' => '车座计价'));
  95. //
  96. // $sql12 = "select supplier_id,bus_res_id, base_cost from base_bus_cost where id > 0 ";
  97. // $result12 = $pdo->query($sql12);
  98. // $json12 = $result12->fetchAll(PDO::FETCH_ASSOC);
  99. // $base_cost = array();
  100. // foreach( $json12 as $base_cost_info ) {
  101. // $supplier_id = $base_cost_info["supplier_id"];
  102. // $bus_res_id = $base_cost_info["bus_res_id"];
  103. // if( !isset($base_cost[$supplier_id]) ) {
  104. // $base_cost[$supplier_id] = array();
  105. // }
  106. // $base_cost[$supplier_id][$bus_res_id] = $base_cost_info["base_cost"];
  107. // }
  108. // $data['base_cost'] = $base_cost;
  109. // $sql13 = "select SUM(DISTANCE) as line_distance from opera_station where line_id = {$json1[0]['lineid']} ";
  110. // $result13 = $pdo->query($sql13);
  111. // if( $result13 != false ) {
  112. // $json13 = $result13->fetchAll(PDO::FETCH_ASSOC);
  113. // $data['line_distance'] = $json13[0]["line_distance"];
  114. // } else {
  115. // $data['line_distance'] = 0;
  116. // }
  117. // /*
  118. // echo "jason1=<br />";print_r($json1);echo "<hr />";
  119. // echo "jason2=<br />";print_r($json2);echo "<hr />";
  120. // echo "jason3=<br />";print_r($json3);echo "<hr />";
  121. // echo "jason4=<br />";print_r($json4);echo "<hr />";
  122. // echo "jason5=<br />";print_r($json5);echo "<hr />";
  123. // echo "jason6=<br />";print_r($json6);echo "<hr />";
  124. // echo "data=<br />";print_r($data);echo "<hr />";
  125. // */
  126. // $sql7="CALL SP_GET_RUN_TICKET_INFO('".$USER_ID."','".$RUN_ID."')";
  127. // if(is_object($pdo)){
  128. // $stmt=$pdo->query($sql7);
  129. // $i = 1;
  130. // do{
  131. // $rowset = $stmt->fetchAll(PDO::FETCH_ASSOC);
  132. // if($i==1){
  133. // $data['order_ticket_info_list']=$rowset;
  134. // }else if ($i==2){
  135. // $data['not_in_order_ticket_info_list']=$rowset;
  136. //
  137. // }else{
  138. // }
  139. // $i++;
  140. // }while ($stmt->nextRowset());
  141. // }
  142. // $stmt->closeCursor();
  143. break;
  144. }
  145. if (is_array($data)){
  146. echo json_encode($data);
  147. } else {
  148. echo $data;
  149. }
  150. exit;
  151. //require_once '../Common/Config.php';