trippest 查询:接送信息补充, 从HT子订单读取

feature/pay
lyt 7 years ago
parent 96899b40af
commit 8774adaf1f

@ -74,19 +74,32 @@ class Api extends CI_Controller {
}
}
// 加上行程
$num_index = 0;
foreach ($ret['operation'] as $kro => &$vro) {
$out_datetime = strtotime($vro['start_date']);
$vro['dateWeek_text'] = date('D', $out_datetime);
$vro['dateDay_text'] = date('d', $out_datetime);
$vro['dateMonth_text'] = date('M', $out_datetime);
$vro['dateYear_text'] = date('Y', $out_datetime);
$poi = $order_project[0];
$poi = new stdclass();
foreach ($order_project as $kd => $poi_info) {
if (strcmp($vro['start_date'], substr($poi_info->COLD_StartDate, 0, 10) ) === 0) {
$poi = $poi_info;
break;
if (count((array)$poi)===0) {
$poi = $poi_info;
} else if ($poi->POI_Hotel == "") {
$poi->POI_Hotel = $poi_info->POI_Hotel;
$poi->POI_HotelAddress = $poi_info->POI_HotelAddress;
$poi->POI_HotelPhone = $poi_info->POI_HotelPhone;
// } else if ($poi->POI_FlightsNo == "") {
} else if ($poi_info->POI_FlightsNo != "" && $poi_info->COLD_SN != $poi->COLD_SN) {
$poi->POI_FlightsNo .= "; " . $poi_info->POI_FlightsNo;
// $poi->POI_AirPort .= "; " . $poi_info->POI_AirPort;
}
}
}
if (count((array)$poi)===0) {
$poi = $order_project[0];
}
$vro['cold_date'] = $poi->COLD_StartDate;
$vro['cold_enddate'] = $poi->COLD_EndDate;
$vro['tour_name'] = $poi->PAG2_Name;
@ -113,14 +126,26 @@ class Api extends CI_Controller {
$vro['pick_up'] = "";
$vro['drop_off'] = "";
$decode_MemoText = $memo_text_tmp = "";
if ($poi->COLD_MemoText != null && json_decode($poi->COLD_MemoText) != null) {
$decode_MemoText = json_decode($poi->COLD_MemoText, true);
$vro['pick_up'] = $decode_MemoText['Pick up'];
$vro['drop_off'] = $decode_MemoText['Drop off'];
} else {
if ($num_index == 0) {
$vro['pick_up'] = trim(substr(strstr(strstr($poi->COLI_OrderDetailText, "Pick Up From:"), "\n", true), 13));
$vro['drop_off'] = trim(substr(strstr(strstr($poi->COLI_OrderDetailText, "Drop Off:"), "\n" , true), 9));
}
// if ($vro['pick_up'] === "") {
if (strval($poi->PAGS_Direction) === '0') {
$vro['pick_up'] .= $poi->POI_FlightsNo . " " . $poi->POI_AirPort;
$vro['drop_off'] .= $poi->POI_Hotel;
} else if (strval($poi->PAGS_Direction) === '1') {
$vro['pick_up'] .= $poi->POI_Hotel;
$vro['drop_off'] .= $poi->POI_FlightsNo . " " . $poi->POI_AirPort;
} else { // if ($poi->POI_FlightsNo != "")
$vro['pick_up'] .= $poi->POI_Hotel;
// $vro['drop_off'] .= $poi->POI_FlightsNo . " " . $poi->POI_AirPort; // 结束后送机
}
// }
// if ($vro['pick_up'] === "" && $poi->POI_FlightsNo == '') {
// $vro['pick_up'] = $vro['drop_off'] = $poi->POI_Hotel;
// }
$num_index++;
}
unset($vro);
}

@ -1303,6 +1303,7 @@ class Orders_model extends CI_Model {
GCI_SN,GCI_VendorOrderId,GCI_combineNo
,COLI_SN,COLI_ID,COLD_SN,COLI_GroupCode,COLI_OPI_ID,COLI_OrderDetailText
,COLD_ServiceSN,COLD_PersonNum,COLD_ChildNum,COLD_StartDate,COLD_EndDate,cold.COLD_MemoText
,pags.PAGS_Direction,pags.PAGS_describ
,pag2.PAG2_Name
,poi.POI_Hotel,poi.POI_HotelAddress,poi.POI_HotelPhone
,poi.POI_AirPort,poi.POI_FlightsNo
@ -1313,19 +1314,21 @@ class Orders_model extends CI_Model {
inner join BIZ_PackageOrderInfo poi on poi.POI_COLD_SN=COLD_SN
inner join BIZ_GUEST g on g.GUT_SN=COLI_GUT_SN
inner join BIZ_PackageInfo2 pag2 on pag2.PAG2_PAG_SN=COLD_ServiceSN and pag2.PAG2_LGC=1
left join BIZ_PackageInfoSub pags on pags.PAGS_SN=cold.COLD_ServiceSN2
where COLI_GroupCode like '%" . $this->HT->escape_like_str($COLI_ID) . "%'
OR COLI_ID like '%" . $this->HT->escape_like_str($COLI_ID) . "%'";
OR COLI_ID like '%" . $this->HT->escape_like_str($COLI_ID) . "%'
order by COLD_StartDate asc";
// OR COLI_ID like '%" . $this->HT->escape_like_str($COLI_ID) . "%'
$order_info_query = $this->HT->query($order_info_sql);
$ret = $order_info_query->result();
if ($order_info_query->num_rows() > 0) {
// $operation_sql = "SELECT gcod.*
// from GroupCombineOperationDetail gcod
// where GCOD_GCI_combineNo=?
// and gcod.GCOD_operationType in ('touristCarOperations','guiderOperations')";
// $operation_info = $this->HT->query($operation_sql, array($ret['order_info'][0]->GCI_combineNo));
// $ret['operation_info'] = $operation_info->result();
}
// if ($order_info_query->num_rows() > 0) {
// $operation_sql = "SELECT gcod.*
// from GroupCombineOperationDetail gcod
// where GCOD_GCI_combineNo=?
// and gcod.GCOD_operationType in ('touristCarOperations','guiderOperations')";
// $operation_info = $this->HT->query($operation_sql, array($ret['order_info'][0]->GCI_combineNo));
// $ret['operation_info'] = $operation_info->result();
// }
return $ret;
}

Loading…
Cancel
Save