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.
 
 
 
 

63 lines
2.2 KiB

  1. <?php
  2. /*
  3. Author:LB
  4. Compeny:Spiders Travel
  5. */
  6. require_once '../Common/Mysql.php';
  7. if (ALLOW_ORIGIN)
  8. header("Access-Control-Allow-Origin:*");
  9. $run_id=isset($_GET['run_id'])?$_GET['run_id']:'';
  10. if($run_id==""){
  11. $data['code']="-1";
  12. $data['info']="缺少班次id";
  13. echo json_encode($data);
  14. exit();
  15. }
  16. $pdo=conn();
  17. $sql="select
  18. A.PARENT_ORDER_ID as parent_order_id,
  19. A.RUN_ID as run_id,
  20. A.PROD_NAME as order_name,
  21. A.CUSTOMER_NAME as customer_name,
  22. A.CUSTOMER_MOBILE as customer_mobile,
  23. A.RUN_DATE as run_date,
  24. A.RUN_TIME as run_time,
  25. A.PROD_START_STATION_RES_NAME as start_station,
  26. A.PROD_END_STATION_RES_NAME as end_station
  27. from order_main as A
  28. where A.RUN_ID=".$run_id."
  29. group by A.PARENT_ORDER_ID
  30. ;";
  31. if(is_object($pdo)){
  32. $result=$pdo->query($sql);
  33. $data=array();
  34. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  35. }
  36. $ary_east = array( 164006 );
  37. //$base_message = "您预订的2016年7月5日上海-乌镇的车次车牌号沪D60147即将在明日07:40出发,请提前达到上车点黄浦旅游集散站,凭乘车订单号{订单号}上车,司机电话王13621669654,祝您旅途愉快!";
  38. foreach( $rowset as $row_info ) {
  39. if( $run_id == 163876) {
  40. $base_message = "您预订的2016年7月9日上海-乌镇的车次车牌号沪BR2131即将在明日07:40出发,请提前达到上车点黄浦旅游集散站,凭乘车订单号" . $row_info["parent_order_id"] . "上车,司机电话李13816024416,祝您旅途愉快!";
  41. //$response = sendTelMessage($row_info["customer_mobile"], $row_info["customer_name"], $base_message, $row_info["parent_order_id"]);
  42. } else {
  43. if( in_array($row_info["parent_order_id"], $ary_east) ) {
  44. $start_time = "15:45";
  45. $start_area = "东栅停车场";
  46. } else {
  47. $start_time = "15:30";
  48. $start_area = "西栅1号停车场";
  49. }
  50. $base_message = "您预订的2016年7月9日乌镇-上海的车次车牌号沪BR2131即将在明日".$start_time."出发,请提前达到上车点".$start_area.",凭乘车订单号" . $row_info["parent_order_id"] . "上车,司机电话李13816024416,祝您旅途愉快!";
  51. $response = sendTelMessage($row_info["customer_mobile"], $row_info["customer_name"], $base_message, $row_info["parent_order_id"]);
  52. }
  53. echo $base_message."<br />";
  54. }
  55. echo "send end";
  56. exit;