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.
 
 
 
 

44 lines
1.2 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. $userid=getUserId();
  10. if ($userid ===false){
  11. echo json_encode(array("code"=>1,"info"=>"用户未登录"));
  12. exit;
  13. }
  14. $runid=$_GET['runid'];
  15. $startime=$_GET['startime'];
  16. $allstation=$_GET['allstation'];
  17. $allcar=$_GET['allcar'];
  18. $allticket=$_GET['allticket'];
  19. $sellday=$_GET['sellday'];
  20. $pdo=conn();
  21. $sql="call sp_bus_run_update(".$userid.",".$runid.",'".$startime."','".$allstation."','".$allcar."','".$allticket."',".$sellday.")";
  22. writeLog("sp_bus_run_update: ".$sql);
  23. if (is_object($pdo)){
  24. $result=$pdo->query($sql);
  25. $rowset=$result->fetchAll(PDO::FETCH_ASSOC);
  26. $result->closeCursor();
  27. $allcar = substr($allcar,1,-1);
  28. $allcar = explode('}{',$allcar);
  29. foreach ($allcar as $key => $vel){
  30. $vel = explode(',',$vel);
  31. if($vel[0] != 0){
  32. $sql = "update run_bus set cost_motorcade_id = " . $vel[4] . ",cost_type = " . $vel[5] . ",cost_price = " . $vel[6] . " where run_id = " . $runid . " and bus_order_id = " . $vel[0] . " and cancel_flag = 0";
  33. $result=$pdo->exec($sql);
  34. }
  35. }
  36. echo json_encode($rowset[0]);
  37. }