當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。