当前位置: 首页>>代码示例>>PHP>>正文


PHP DB_test::get_insert_id方法代码示例

本文整理汇总了PHP中DB_test::get_insert_id方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_test::get_insert_id方法的具体用法?PHP DB_test::get_insert_id怎么用?PHP DB_test::get_insert_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DB_test的用法示例。


在下文中一共展示了DB_test::get_insert_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAirlineDetail


//.........这里部分代码省略.........
				$flightsListNode = $domesticFlightRouteNode->FlightsList;
				foreach ($flightsListNode->children() as $flightNode)
				{
					$sql = "INSERT INTO ctrip_airticket_flight_list (depart_city_code, depart_port_code, 
					arrive_city_code, arrive_port_code, 
					depart_time, arrive_time, 
					flight, craft_code, 
					airline_iata_code, seat_class, 
					sub_seat_class, display_sub_seat_class, 
					rate, price, 
					standard_price, tax, 
					oil_fee, standard_price_for_child, 
					tax_for_child, oil_fee_for_child, 
					standard_price_for_baby, tax_for_baby, 
					oil_fee_for_baby, meal_type, 
					stop_count, rer_code, 
					end_code, ref_code, 
					rer_note, end_note, 
					ref_note, remark, 
					quantity, punctuality_rate, 
					ticket_type, price_type, 
					product_type, product_source, 
					inventory_type, before_fly_date, 
					route_index, need_apply, 
					recommend, refund_fee_formula_id, 
					can_up_grade, 
					can_separate_sale, 
					can_no_defer, 
					can_post, 
					is_fly_man, 
					only_own_city, 
					is_lowest_cz_special_price, 
					allow_cp_type, 
					policy_id, 
					is_rebate, 
					rebate_amount) 
					VALUES 
					('" . $flightNode->DepartCityCode . "', '" . strval($flightNode->DPortCode) . "', '" . 
					strval($flightNode->ArriveCityCode) . "', '" . strval($flightNode->APortCode) . "', '" . 
					strval($flightNode->TakeOffTime) . "', '" . strval($flightNode->ArriveTime) . "', '" . 
					strval($flightNode->Flight) . "', '" . strval($flightNode->CraftType) . "', '" . 
					strval($flightNode->AirlineCode) . "', '" . strval($flightNode->Class) . "', '" . 
					strval($flightNode->SubClass) . "', '" . strval($flightNode->DisplaySubclass) . "', " . 
					doubleval($flightNode->Rate) . ", " . doubleval($flightNode->Price) . ", " . 
					doubleval($flightNode->StandardPrice) . ", " . doubleval($flightNode->AdultTax) . ", " . 
					doubleval($flightNode->AdultOilFee) . ", " . doubleval($flightNode->ChildStandardPrice) . ", " . doubleval($flightNode->ChildTax) . ", " . doubleval($flightNode->ChildOilFee) . ", " . 
					doubleval($flightNode->BabyStandardPrice) . ", " . doubleval($flightNode->BabyTax) . ", " . 
					doubleval($flightNode->BabyOilFee) . ", '" . strval($flightNode->MealType) . "', " . 
					intval($flightNode->StopTimes) . ", '" . strval($flightNode->Nonrer) . "', '" . 
					strval($flightNode->Nonend) . "', '" . strval($flightNode->Nonref) . "', '" . 
					strval($flightNode->Rernote) . "', '" . strval($flightNode->Endnote) . "', '" . 
					strval($flightNode->Nonref) . "', '" . strval($flightNode->Remarks) . "', " . 
					intval($flightNode->Quantity) . ", " . doubleval($flightNode->PunctualityRate) . ", " . 
					intval($flightNode->TicketType) . ", '" . strval($flightNode->PriceType) . "', '" . 
					strval($flightNode->ProductType) . "', " . intval($flightNode->ProductSource) . ", '" . 
					strval($flightNode->InventoryType) . "', " . intval($flightNode->BeforeFlyDate) . ", " . 
					intval($flightNode->RouteIndex) . ", '" . strval($flightNode->NeedApplyString) . "', " . 
					intval($flightNode->Recommend) . ", " . intval($flightNode->RefundFeeFormulaID) . ", " . 
					((strval($flightNode->CanUpGrade) == "true") ? 1 : 0) . ", " . 
					((strval($flightNode->CanSeparateSale) == "true") ? 1 : 0) . ", " . 
					((strval($flightNode->CanNoDefer) == "true") ? 1 : 0) . ", " . 
					((strval($flightNode->CanPost) == "true") ? 1 : 0) . ", " . 
					((strval($flightNode->IsFlyMan) == "true") ? 1 : 0) . ", " . 
					((strval($flightNode->OnlyOwnCity) == "true") ? 1 : 0) . ", " . 
					((strval($flightNode->IsLowestCZSpecialPrice) == "true") ? 1 : 0) . ", " . 
					intval($flightNode->AllowCPType) . ", " . intval($flightNode->PolicyID) . ", " . 
					((strval($flightNode->IsRebate) == "true") ? 1 : 0) . ", " . 
					intval($flightNode->PolicyID) . ");";
					$sql = auto_charset($sql, 'utf-8', 'gbk');
					$db->query($sql);
					$flightCount++;
				}
			}
			$lastInsertId = $db->get_insert_id();
			
			$sql = "SELECT id, flight, price, standard_price AS standardPrice, oil_fee AS oilFee, tax, standard_price_for_child AS standardPriceForChild, oil_fee_for_child AS oilFeeForChild, tax_for_child AS taxForChild, standard_price_for_baby AS standardPriceForBaby, oil_fee_for_baby AS oilFeeForBaby, tax_for_baby AS taxForBaby, quantity, display_sub_seat_class AS class, rer_note AS rerNote, end_note AS endNote, ref_note AS refNote FROM ctrip_airticket_flight_list WHERE depart_city_code = '" . $departCityCode . "' AND arrive_city_code = '" . $arriveCityCode . "' AND flight = '" . $flight . "' AND id > " . ($lastInsertId - $flightCount);
			
			if($returnDate != "" && $returnTime != "" && $returnFlight != "")
			{
				$sql .= " UNION SELECT id, flight, price, standard_price AS standardPrice, oil_fee AS oilFee, tax, standard_price_for_child AS standardPriceForChild, oil_fee_for_child AS oilFeeForChild, tax_for_child AS taxForChild, standard_price_for_baby AS standardPriceForBaby, oil_fee_for_baby AS oilFeeForBaby, tax_for_baby AS taxForBaby, quantity, display_sub_seat_class AS class, rer_note AS rerNote, end_note AS endNote, ref_note AS refNote FROM ctrip_airticket_flight_list WHERE depart_city_code = '" . $arriveCityCode . "' AND arrive_city_code = '" . $departCityCode . "' AND flight = '" . $returnFlight . "' AND id > " . ($lastInsertId - $flightCount);
			}
			
			$db->query($sql);
			$arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8');
			$arr_message = array("result" => "success", "message" => "查询航班成功");
		}
		else
		{
			$arr_message = array("result" => "success", "message" => "航班信息有误");
		}
		
		$retcode = "0";
		
		$arr_msg['msgbody']['result'] = $arr_message['result'];
		$arr_msg['msgbody']['message'] = $arr_message['message'];
		
		$returnvalue = array ("msgbody" => $arr_msg['msgbody']);
		$returnval = TfbxmlResponse :: ResponsetoApp($retcode, $returnvalue);
		return $returnval;
	}
开发者ID:uin57,项目名称:doc,代码行数:101,代码来源:ApiAirticket.php


注:本文中的DB_test::get_insert_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。