exec($insert_sql); } foreach ($disney2 as $disney_info) { $prod_name = "迪士尼两日门票"; $prod_code = DISNEY_CODE2; $cs_prod_id = 0; if( mb_strpos($disney_info["ticketname"], "成人") != false ) { $cs_prod_id = 387541; } else if( mb_strpos($disney_info["ticketname"], "老人") != false ) { $cs_prod_id = 387542; } else if( mb_strpos($disney_info["ticketname"], "儿童") != false ) { $cs_prod_id = 387543; } $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) " . " 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;"; $pdo_insert->exec($insert_sql); } $date = date("Y-m-d", strtotime($date." +1 days")); } exit();