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.
 
 
 
 

74 lines
2.0 KiB

  1. <?php
  2. /*
  3. Author:ZSQ
  4. Compeny:Spiders Travel
  5. */
  6. require_once '../Common/Mysql.php';
  7. header("Access-Control-Allow-Origin:*");
  8. $method=isset($_GET['method'])?$_GET['method']:"";
  9. if($method==""){
  10. echo json_encode(array("code"=>"-1","info"=>"没有method"));
  11. exit();
  12. }
  13. //$user_id=getUserId();
  14. //if ($user_id ===false){
  15. // echo json_encode(array("errcode"=>1,"errinfo"=>"用户未登录"));
  16. // exit;
  17. //}
  18. if($method=="get_run_back_station"){
  19. $pdo=conn();
  20. $cur_run_id=isset($_GET['cur_run_id'])?$_GET['cur_run_id']:'';
  21. $date_f= isset($_GET['date_f'])?$_GET['date_f']:'';
  22. $sql="CALL SP_GET_RUN_BACK_STATION('".$date_f."',".$cur_run_id.")";
  23. writeLog('get_run_back_station sql='.$sql);
  24. if($pdo){
  25. $result=$pdo->query($sql);
  26. if($result){
  27. $re_da=array();
  28. $data['code']='0';
  29. $data['info']='';
  30. do{
  31. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  32. $re_da[]=isset($rowset)?$rowset:array();
  33. }while($result->nextRowset());
  34. $data['start_station_list']=$re_da[0];
  35. $data['end_station_list']=$re_da[1];
  36. }else{
  37. $data['code']="400";
  38. $data['info']="mysql sql error fail";
  39. }
  40. }else{
  41. $data['code']="500";
  42. $data['info']="mysql conn error fail";
  43. }
  44. echo json_encode($data);
  45. exit();
  46. }else if($method=="get_run_back_info"){
  47. $pdo=conn();
  48. $f_run_id=isset($_GET['f_run_id'])?$_GET['f_run_id']:"";
  49. $f_st_res_id=isset($_GET['f_st_res_id'])?$_GET['f_st_res_id']:"";
  50. $f_end_res_id=isset($_GET['f_end_res_id'])?$_GET['f_end_res_id']:"";
  51. if($f_run_id=="" || $f_st_res_id=="" || $f_end_res_id==""){
  52. echo json_encode(array("code"=>"-1","info"=>"缺少参数"));
  53. exit();
  54. }
  55. $sql="CALL SP_GET_BACK_INFO('".$f_run_id."','".$f_st_res_id."','".$f_end_res_id."')";
  56. writeLog('get_run_back_info sql='.$sql);
  57. $result=$pdo->query($sql);
  58. $data=array();
  59. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  60. $data['code']='0';
  61. $data['info']='';
  62. $data['run_id']=isset($rowset[0]) ? $rowset[0]['run_id'] : "";
  63. $data['prod_id']=isset($rowset[0]) ?$rowset[0]['prod_id'] : "";
  64. echo json_encode($data);
  65. exit();
  66. }