查询: 没有调度依然返回订单信息; 同步: 获取匹配的供应商订单id

feature/trippest
lyt 7 years ago
parent 787b879b6b
commit 16d2b5a6e4

@ -275,7 +275,7 @@ class TulanduoApi extends CI_Controller
if (strlen($real_groupCode) < 9) {
$real_groupCode = $real_groupCode_info['all'];
}
$getInfo_byGroupCodeArr = $this->Orders_model->get_order_by_groupcode($real_groupCode);
$getInfo_byGroupCodeArr = $this->Orders_model->get_order_by_groupcode($real_groupCode, $order->GCI_VendorOrderId);
}
$duplicate = false;
// 由同步新增的订单 或 未找到团号关联

@ -302,6 +302,72 @@ class Api extends CI_Controller {
$num_index++;
}
unset($vro);
} else {
foreach ($order_project as $kd => $poi) {
$vro = array();
$vro['start_date_raw'] = $vro['start_date'] = substr($poi->COLD_StartDate, 0, 10);
$out_datetime = strtotime($poi->COLD_StartDate);
$out_datetime2 = strtotime($poi->COLD_EndDate);
$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);
if ($out_datetime !== $out_datetime2) {
$vro['start_date'] = $poi->COLD_StartDate . " to " . $poi->COLD_EndDate;
}
$vro['cold_date'] = $poi->COLD_StartDate;
$vro['cold_enddate'] = $poi->COLD_EndDate;
$vro['tour_name'] = $poi->PAG2_Name;
$code_name = $this->trippest->tour_name(strtoupper($poi->pag_code));
if ($code_name !== "") {
$vro['tour_name'] = $code_name;
}
// 领队名字
$vro['leader_name'] = trim($poi->GUT_FirstName . " " . $poi->GUT_LastName);
// 行程人数
$vro['personNum_text'] = $poi->COLD_PersonNum + $poi->COLD_ChildNum;
$vro['personNum_text'] .= " (" . $poi->COLD_PersonNum . " Adult(s)";
if ($poi->COLD_ChildNum > 0) {
$vro['personNum_text'] .= " " . $poi->COLD_ChildNum . " Child(ren)";
}
$vro['personNum_text'] .= ")" ;
// 人数
$vro['adult_number'] = $order_project[0]->COLD_PersonNum;
$vro['kid_number'] = $order_project[0]->COLD_ChildNum;
// 酒店
$vro['hotel_name'] = $poi->POI_Hotel;
$vro['hotel_address'] = $poi->POI_HotelAddress;
$vro['hotel_tel'] = $poi->POI_HotelPhone;
// 航班/车次
$vro['flights_no'] = $poi->POI_FlightsNo;
$vro['flights_airport'] = $poi->POI_AirPort;
// 接送信息
$vro['pick_up'] = "";
$vro['drop_off'] = "";
$decode_MemoText = $memo_text_tmp = "";
if ($vro['pick_up'] === "" && $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'];
}
if ($vro['pick_up'] === "" && $kd == 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; // 结束后送机
}
}
$ret['operation'][] = $vro;
}
}
$ret['operation'] = array_values($ret['operation']);
$ret_operation = array();

@ -576,10 +576,13 @@ class Orders_model extends CI_Model {
* @date 2018-08-23
* @param [type] $code [description]
*/
public function get_order_by_groupcode($code)
public function get_order_by_groupcode($code, $order_id=0)
{
$sql = "SELECT COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,
(select gci_vendororderId from groupcombineinfo where gci_gri_sn=coli_gri_sn) as gci,
(select top 1 case gci_vendororderId when $order_id then gci_vendororderId else 0 end
from groupcombineinfo where gci_gri_sn=coli_gri_sn
order by case gci_vendororderId when $order_id then 0 else 1 end asc
) as gci,
coli.COLI_OrderDetailText,coli.COLI_GroupCode,coli.COLI_GRI_SN,
coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency
GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name,

@ -15,13 +15,14 @@
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="referrer" content="always">
<link href="//data.chinahighlights.com/css/min.php?f=/public/css/global.min.css&amp;v=20180811" rel="stylesheet" type="text/css" />
<link href="http://www.mycht.cn/css/webht/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<style type="text/css" media="screen and (max-width:767px)">
.pay_form .form-group{padding-left: 0!important;padding-right: 0!important;}
.pay_form .result_info{padding-top: 5px!important;}
</style>
<style type="text/css">
li{list-style: none;}
p{margin-bottom: 8.5px;}
a{text-decoration: none;}
.text_padding {padding: 10px ;}

Loading…
Cancel
Save