|
|
|
@ -431,28 +431,24 @@ class api extends CI_Controller
|
|
|
|
|
//航班对应可用的资源列表
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList = array();
|
|
|
|
|
$j = 0;
|
|
|
|
|
$Y = 0; //Y仓单独计数
|
|
|
|
|
$otherCabin = "";//其它舱位也只读取第一个
|
|
|
|
|
foreach ($items->resourceList as $resourceItems) {
|
|
|
|
|
|
|
|
|
|
//只读取全价
|
|
|
|
|
if ($resourceItems->price->adultFacePrice == $resourceItems->price->cabinClassFullPrice && $resourceItems->price->adultPrice == $resourceItems->price->cabinClassFullPrice){
|
|
|
|
|
//只显示经济舱
|
|
|
|
|
$isY = false;
|
|
|
|
|
foreach ($resourceItems->cabinList as $cabinListItems) {
|
|
|
|
|
if ($cabinListItems->cabinClass == "Y"){
|
|
|
|
|
$isY = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($isY){
|
|
|
|
|
//根据舱位分别处理,Y仓只要一个。
|
|
|
|
|
$arrCabinListItems = $resourceItems->cabinList;
|
|
|
|
|
$cabinListItems = $arrCabinListItems[0];
|
|
|
|
|
if ($cabinListItems->cabinClass == "Y" && $Y==0){
|
|
|
|
|
//只处理第一次的Y仓
|
|
|
|
|
if (count($items->resourceList)>0){
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j] = new stdClass();
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price = new stdClass();
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultPrice = $resourceItems->price->adultPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->childPrice = $resourceItems->price->childPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->adultFacePrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->childFacePrice = $resourceItems->price->childFacePrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->cabinClassFullPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultTax = $resourceItems->price->adultTax;
|
|
|
|
|
|
|
|
|
|
$k = 0;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k] = new stdClass();
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClass = $cabinListItems->cabinClass;
|
|
|
|
@ -462,31 +458,32 @@ class api extends CI_Controller
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->billType = $cabinListItems->billType;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->seatStatus = $cabinListItems->seatStatus;
|
|
|
|
|
|
|
|
|
|
$Y++;
|
|
|
|
|
$j++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else if ($cabinListItems->cabinClass != "Y"){
|
|
|
|
|
|
|
|
|
|
$checkExitCabin = false;
|
|
|
|
|
foreach ($cacheData->queryResultList[$i]->resourceList as $cCabin) {
|
|
|
|
|
if ($cabinListItems->cabinClass == $cCabin->cabinList[0]->cabinClass){
|
|
|
|
|
$checkExitCabin = true; //判断是否已经添加了该类型的仓。
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
//没有全价的处理,默认加上一个全价
|
|
|
|
|
if ($j===0){
|
|
|
|
|
if (count($items->resourceList)>0){
|
|
|
|
|
}
|
|
|
|
|
if ($cabinListItems->cabinClass != $otherCabin && $checkExitCabin==false){
|
|
|
|
|
//其它仓
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j] = new stdClass();
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price = new stdClass();
|
|
|
|
|
|
|
|
|
|
$resourceList = $items->resourceList;
|
|
|
|
|
$resourceItems = $resourceList[0];
|
|
|
|
|
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->childPrice = $resourceItems->price->childPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->adultFacePrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->childFacePrice = $resourceItems->price->childFacePrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->cabinClassFullPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->price->adultTax = $resourceItems->price->adultTax;
|
|
|
|
|
|
|
|
|
|
$k = 0;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k] = new stdClass();
|
|
|
|
|
|
|
|
|
|
$cabinList = $resourceItems->cabinList;
|
|
|
|
|
$cabinListItems = $cabinList[0];
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClass = $cabinListItems->cabinClass;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClassName = $cabinListItems->cabinClassName;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggage = $cabinListItems->freeLuggage;
|
|
|
|
@ -494,9 +491,105 @@ class api extends CI_Controller
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->billType = $cabinListItems->billType;
|
|
|
|
|
$cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->seatStatus = $cabinListItems->seatStatus;
|
|
|
|
|
|
|
|
|
|
$otherCabin = $cabinListItems->cabinClass;
|
|
|
|
|
$j++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //只读取全价,Y仓
|
|
|
|
|
// if ($resourceItems->price->adultFacePrice == $resourceItems->price->cabinClassFullPrice && $resourceItems->price->adultPrice == $resourceItems->price->cabinClassFullPrice){
|
|
|
|
|
// //只显示经济舱
|
|
|
|
|
// $isY = false;
|
|
|
|
|
// foreach ($resourceItems->cabinList as $cabinListItems) {
|
|
|
|
|
// if ($cabinListItems->cabinClass == "Y"){
|
|
|
|
|
// $isY = true;
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if ($isY){
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j] = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultPrice = $resourceItems->price->adultPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->childPrice = $resourceItems->price->childPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->adultFacePrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->childFacePrice = $resourceItems->price->childFacePrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->cabinClassFullPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultTax = $resourceItems->price->adultTax;
|
|
|
|
|
|
|
|
|
|
// $k = 0;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k] = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClass = $cabinListItems->cabinClass;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClassName = $cabinListItems->cabinClassName;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggage = $cabinListItems->freeLuggage;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggageUnit = $cabinListItems->freeLuggageUnit;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->billType = $cabinListItems->billType;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->seatStatus = $cabinListItems->seatStatus;
|
|
|
|
|
|
|
|
|
|
// $j++;
|
|
|
|
|
// $Y++;
|
|
|
|
|
// }
|
|
|
|
|
// }else{
|
|
|
|
|
// //非全价的只显示其它舱位
|
|
|
|
|
// $arrCabinListItems = $resourceItems->cabinList;
|
|
|
|
|
// $cabinListItems = $arrCabinListItems[0];
|
|
|
|
|
// if ($cabinListItems->cabinClass != "Y"){
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j] = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultPrice = $resourceItems->price->adultPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->childPrice = $resourceItems->price->childPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->adultFacePrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->childFacePrice = $resourceItems->price->childFacePrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->cabinClassFullPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultTax = $resourceItems->price->adultTax;
|
|
|
|
|
|
|
|
|
|
// $k = 0;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k] = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClass = $cabinListItems->cabinClass;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClassName = $cabinListItems->cabinClassName;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggage = $cabinListItems->freeLuggage;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggageUnit = $cabinListItems->freeLuggageUnit;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->billType = $cabinListItems->billType;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->seatStatus = $cabinListItems->seatStatus;
|
|
|
|
|
|
|
|
|
|
// $j++;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// //Y仓没有全价的处理,默认加上一个全价
|
|
|
|
|
// if ($Y===0){
|
|
|
|
|
// if (count($items->resourceList)>0){
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j] = new stdClass();
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price = new stdClass();
|
|
|
|
|
|
|
|
|
|
// $resourceList = $items->resourceList;
|
|
|
|
|
// $resourceItems = $resourceList[0];
|
|
|
|
|
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->childPrice = $resourceItems->price->childPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultFacePrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->childFacePrice = $resourceItems->price->childFacePrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->cabinClassFullPrice = $resourceItems->price->cabinClassFullPrice;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->price->adultTax = $resourceItems->price->adultTax;
|
|
|
|
|
// $k = 0;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k] = new stdClass();
|
|
|
|
|
|
|
|
|
|
// $cabinList = $resourceItems->cabinList;
|
|
|
|
|
// $cabinListItems = $cabinList[0];
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClass = $cabinListItems->cabinClass;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->cabinClassName = $cabinListItems->cabinClassName;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggage = $cabinListItems->freeLuggage;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->freeLuggageUnit = $cabinListItems->freeLuggageUnit;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->billType = $cabinListItems->billType;
|
|
|
|
|
// $cacheData->queryResultList[$i]->resourceList[$j]->cabinList[$k]->seatStatus = $cabinListItems->seatStatus;
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|