|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Redstop
- * Date: 2016/12/17
- * Time: 11:57
- */
- header("Content-type:text/html;charset=utf-8");
- require_once __DIR__.'/../Common/Mysql.php';
- require_once __DIR__.'/../Common/zizai_api.inc';
-
- $start_date = date("Y-m-d");
- $disney_memory = get_memcache('lion_threater_info');
-
- $disney_memory2 = $disney_memory;
- foreach( $disney_memory2 as $disney_date => $data_info ) {
- if( $disney_date < $start_date ) {
- unset( $disney_memory[$disney_date]);
- }
- }
-
- $pdo = conn1();
- $sql = " SELECT * FROM outside_ticket WHERE prod_code IN('DSNSZW') AND ticket_date >= '{$start_date}' AND update_time >= '{$start_date} 00:00:00' AND cancel_flag = 0 ORDER BY ticket_date,ticket_time ";
- $result = $pdo->query($sql);
- $rowset = $result->fetchAll();
-
- $disney_ticket_array = array();
- foreach( $rowset as $row_info ) {
- $ticket_date = $row_info["ticket_date"];
- $ticket_time = $row_info["ticket_time"];
- if( !isset($disney_ticket_array[$ticket_date]) ) {
- $disney_ticket_array[$ticket_date] = array();
- }
- if( !isset($disney_ticket_array[$ticket_date][$ticket_time]) ) {
- $disney_ticket_array[$ticket_date][$ticket_time] = array();
- }
- if( !isset($disney_ticket_array[$ticket_date][$ticket_time]["tic_info"]) ) {
- $disney_ticket_array[$ticket_date][$ticket_time]["tic_info"] = array( "0" => 0, "1" => 0, "2" => 0, "3" => 0, "4" => 0, "5" => 0 );
- }
- if( !isset($disney_ticket_array[$ticket_date][$ticket_time]["price"]) ) {
- $disney_ticket_array[$ticket_date][$ticket_time]["price"] = array( "0" => 0, "1" => 0, "2" => 0, "3" => 0, "4" => 0, "5" => 0 );
- }
- if( !isset($disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"]) ) {
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"] = array();
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][] = array( "ticketid" => "", "ticketname" => "AA区域", "ticketprice" => 900, "ticketcount" => 0, "agentprice" => 720 );
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][] = array( "ticketid" => "", "ticketname" => "AB区域", "ticketprice" => 700, "ticketcount" => 0, "agentprice" => 560 );
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][] = array( "ticketid" => "", "ticketname" => "BA区域", "ticketprice" => 490, "ticketcount" => 0, "agentprice" => 392 );
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][] = array( "ticketid" => "", "ticketname" => "BB区域", "ticketprice" => 390, "ticketcount" => 0, "agentprice" => 312 );
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][] = array( "ticketid" => "", "ticketname" => "CA区域", "ticketprice" => 290, "ticketcount" => 0, "agentprice" => 232 );
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][] = array( "ticketid" => "", "ticketname" => "CB区域", "ticketprice" => 190, "ticketcount" => 0, "agentprice" => 152 );
- }
-
- $ticket_name = $row_info["ticket_name"];
- $ticket_index = 0;
- if( mb_strpos($ticket_name, "AB") ) {
- $ticket_index = 1;
- } else if( mb_strpos($ticket_name, "BA") ) {
- $ticket_index = 2;
- } else if( mb_strpos($ticket_name, "BB") ) {
- $ticket_index = 3;
- } else if( mb_strpos($ticket_name, "CA") ) {
- $ticket_index = 4;
- } else if( mb_strpos($ticket_name, "CB") ) {
- $ticket_index = 5;
- }
- $disney_ticket_array[$ticket_date][$ticket_time]["tic_info"][$ticket_index] = $row_info["ticket_num"];
- $disney_ticket_array[$ticket_date][$ticket_time]["price"][$ticket_index] = (int)$row_info["ticket_price"];
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][$ticket_index]["ticketid"] = $row_info["ticket_code"];
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][$ticket_index]["ticketprice"] = $row_info["ticket_price"];
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][$ticket_index]["ticketcount"] = $row_info["ticket_num"];
- $disney_ticket_array[$ticket_date][$ticket_time]["ticket_array"][$ticket_index]["agentprice"] = $row_info["agent_price"];
- }
-
- foreach( $disney_ticket_array as $disney_date => $disney_ticket ) {
- $disney_memory[$disney_date] = $disney_ticket;
- }
- set_memcache('lion_threater_info', $disney_memory);
- exit();
|