Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

57 Zeilen
2.9 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Redstop
  5. * Date: 2016/12/17
  6. * Time: 11:57
  7. */
  8. header("Content-type:text/html;charset=utf-8");
  9. require_once __DIR__.'/../Common/Mysql.php';
  10. require_once __DIR__.'/../Common/zizai_api.inc';
  11. $update_time = date("Y-m-d H:i:s");
  12. $end_date = date("Y-m-d", strtotime("+2 months"));
  13. $date = date("Y-m-d");
  14. while( $date <= $end_date ) {
  15. $godate = $date;
  16. $gotime = "";
  17. $disney1 = get_ticket_array(API_USER, API_PASSWORD, DISNEY_CODE1, $godate, $gotime);
  18. $disney2 = get_ticket_array(API_USER, API_PASSWORD, DISNEY_CODE2, $godate, $gotime);
  19. $pdo_insert = conn1();
  20. foreach ($disney1 as $disney_info) {
  21. $prod_name = "迪士尼一日门票";
  22. $prod_code = DISNEY_CODE1;
  23. $cs_prod_id = 0;
  24. if( mb_strpos($disney_info["ticketname"], "成人") != false ) {
  25. $cs_prod_id = 387538;
  26. } else if( mb_strpos($disney_info["ticketname"], "老人") != false ) {
  27. $cs_prod_id = 387539;
  28. } else if( mb_strpos($disney_info["ticketname"], "儿童") != false ) {
  29. $cs_prod_id = 387540;
  30. }
  31. $insert_sql = " INSERT INTO outside_ticket (supplier_id,prod_name,prod_code, ticket_code, ticket_date, ticket_time, ticket_name, ticket_comment, ticket_num, ticket_price, agent_price, cancel_flag, update_time, cs_prod_id) " .
  32. " VALUES (3, '{$prod_name}', '{$prod_code}', '{$disney_info["ticketid"]}', '{$godate}', '', '{$disney_info["ticketname"]}', '', {$disney_info["ticketcount"]}, {$disney_info["ticketprice"]}, {$disney_info["agentprice"]}, 0, '{$update_time}', {$cs_prod_id} ) ON DUPLICATE KEY UPDATE ticket_num={$disney_info["ticketcount"]},update_time='{$update_time}',cancel_flag=0;";
  33. $pdo_insert->exec($insert_sql);
  34. }
  35. foreach ($disney2 as $disney_info) {
  36. $prod_name = "迪士尼两日门票";
  37. $prod_code = DISNEY_CODE2;
  38. $cs_prod_id = 0;
  39. if( mb_strpos($disney_info["ticketname"], "成人") != false ) {
  40. $cs_prod_id = 387541;
  41. } else if( mb_strpos($disney_info["ticketname"], "老人") != false ) {
  42. $cs_prod_id = 387542;
  43. } else if( mb_strpos($disney_info["ticketname"], "儿童") != false ) {
  44. $cs_prod_id = 387543;
  45. }
  46. $insert_sql = " INSERT INTO outside_ticket (supplier_id,prod_name,prod_code, ticket_code, ticket_date, ticket_time, ticket_name, ticket_comment, ticket_num, ticket_price, agent_price, cancel_flag, update_time, cs_prod_id) " .
  47. " VALUES (3, '{$prod_name}', '{$prod_code}', '{$disney_info["ticketid"]}', '{$godate}', '', '{$disney_info["ticketname"]}', '', {$disney_info["ticketcount"]}, {$disney_info["ticketprice"]}, {$disney_info["agentprice"]}, 0, '{$update_time}', {$cs_prod_id} ) ON DUPLICATE KEY UPDATE ticket_num={$disney_info["ticketcount"]},update_time='{$update_time}',cancel_flag=0;";
  48. $pdo_insert->exec($insert_sql);
  49. }
  50. $date = date("Y-m-d", strtotime($date." +1 days"));
  51. }
  52. exit();