|
|
|
@ -111,7 +111,9 @@ class Tulanduo
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$guestlist = $this->ci->orders_model->get_customer_list($gri_sn);
|
|
|
|
|
$request_info = $this->ci->Group_model->get_plan_request($vas->GRI_SN);
|
|
|
|
|
$request_info = $this->ci->Group_model->get_plan_request($gri_sn);
|
|
|
|
|
$plan_remark = $this->ci->Group_model->get_plan_remark($gri_sn, $vei_sn);
|
|
|
|
|
$plan_remark = strval($plan_remark)==='' ? '' : "请导游准备: " . $plan_remark;
|
|
|
|
|
/**
|
|
|
|
|
* TODO:团队类型? 先写2
|
|
|
|
|
* ??是否同一天含多个包价项目
|
|
|
|
@ -129,7 +131,7 @@ class Tulanduo
|
|
|
|
|
$big_order_index = 0;
|
|
|
|
|
$expect_order_cnt = count($grd_apart_info['com'])+intval(!empty($grd_apart_info['big_pvt']))+intval(!empty($grd_apart_info['pvt']));
|
|
|
|
|
foreach ($grd_apart_info as $group_key => $grd_a) {
|
|
|
|
|
$big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index);
|
|
|
|
|
$big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index, $plan_remark);
|
|
|
|
|
}
|
|
|
|
|
if ($big_order_index === $expect_order_cnt) {
|
|
|
|
|
/** VendorArrangeState VAS_IsReceive */
|
|
|
|
@ -143,18 +145,25 @@ class Tulanduo
|
|
|
|
|
* @Date: 2019-05-30 16:11:34
|
|
|
|
|
* @Desc: 执行发送订单计划信息. 参数已拆分归类好的行程
|
|
|
|
|
*/
|
|
|
|
|
public function tour_apart_order_exec($group_type, $vas, $request_info, $guestlist=null, $grd, $total_order_index)
|
|
|
|
|
public function tour_apart_order_exec($group_type, $vas, $request_info, $guestlist=null, $grd, $total_order_index, $plan_remark=null)
|
|
|
|
|
{
|
|
|
|
|
if (empty($grd)) {
|
|
|
|
|
return $total_order_index;
|
|
|
|
|
}
|
|
|
|
|
$userId = $this->send_host["1"]["userId"];
|
|
|
|
|
$userKey = $this->send_host["1"]["key"];
|
|
|
|
|
$destination = $grd['details'][0]->tocity;
|
|
|
|
|
$destination_code = $grd['details'][0]->citycode;
|
|
|
|
|
if (empty($destination)) {
|
|
|
|
|
$vendor_city = $this->ci->Group_model->get_vendor_city($vas->VAS_VEI_SN);
|
|
|
|
|
$destination = $vendor_city->cityname;
|
|
|
|
|
$destination_code = $vendor_city->citycode;
|
|
|
|
|
}
|
|
|
|
|
switch ($group_type) {
|
|
|
|
|
case 'big_pvt':
|
|
|
|
|
$total_order_index ++;
|
|
|
|
|
$all_grd = array($grd);
|
|
|
|
|
$routeName = "中华游" . $grd['details'][0]->tocity . "常规线路";
|
|
|
|
|
$routeName = "中华游" . $destination . "常规线路";
|
|
|
|
|
$routeType = $routeName;
|
|
|
|
|
$agcOrderNo = $vas->GRI_Name;
|
|
|
|
|
// $agcOrderNo .= "(" . $vas->operator . ")";
|
|
|
|
@ -165,7 +174,7 @@ class Tulanduo
|
|
|
|
|
$all_grd = array($grd);
|
|
|
|
|
$routeName = empty($grd['details'][0]->GRD_Landscape) ? $grd['details'][0]->PAG_Title : $grd['details'][0]->GRD_Landscape;
|
|
|
|
|
$routeName .= "(" . $grd['details'][0]->PAG_Code . ")";
|
|
|
|
|
$routeType = $grd['details'][0]->tocity . "目的地线路";
|
|
|
|
|
$routeType = $destination . "目的地线路";
|
|
|
|
|
$agcOrderNo = $vas->GRI_Name;
|
|
|
|
|
// $agcOrderNo .= "(" . $vas->operator . ")";
|
|
|
|
|
$order_type = 1;
|
|
|
|
@ -183,7 +192,7 @@ class Tulanduo
|
|
|
|
|
if (empty($routeName)) {
|
|
|
|
|
$routeName = $vo['details'][0]->GRD_Landscape . "(" . $vo['details'][0]->PAG_Code . ")";
|
|
|
|
|
}
|
|
|
|
|
$routeType = $vo['details'][0]->tocity . "目的地线路";
|
|
|
|
|
$routeType = $destination . "目的地线路";
|
|
|
|
|
$agcOrderNo = $vas->GRI_Name;
|
|
|
|
|
// $agcOrderNo .= "(" . $vas->operator . ")";
|
|
|
|
|
}
|
|
|
|
@ -199,24 +208,53 @@ class Tulanduo
|
|
|
|
|
->setAgcOrderNo($agcOrderNo)
|
|
|
|
|
->setAdultNum(intval($vo['details'][0]->ACI_PersonNum))
|
|
|
|
|
->setChildNum(intval(bcadd($vo['details'][0]->ACI_ChildNum, $vo['details'][0]->ACI_BabyNum)))
|
|
|
|
|
->setDestination($vo['details'][0]->tocity)
|
|
|
|
|
->setDestination($destination)
|
|
|
|
|
->setTravelDate($first_date)
|
|
|
|
|
->setLeavedDate($end_date)
|
|
|
|
|
// ->setOrderRemark($order_remark) // 订单备注 TODO:
|
|
|
|
|
// ->setRoomStandard($request_info->GCI_HotelRequest) // 住房标准
|
|
|
|
|
->setRouteStandard($request_info->GCI_Request) // 行程服务标准
|
|
|
|
|
;
|
|
|
|
|
// 订单备注
|
|
|
|
|
if (strval($plan_remark) !== '') {
|
|
|
|
|
$this->ci->tldOrderBuilder->setOrderRemark($plan_remark);
|
|
|
|
|
}
|
|
|
|
|
$from_country = ""; // 客源地
|
|
|
|
|
if ($guestlist===null) {
|
|
|
|
|
// 商务订单的客人列表
|
|
|
|
|
$g_cold_str = array_map(function ($ele){return $ele->GRD_COLD_SN;}, $vo['details']);
|
|
|
|
|
$guestlist = $this->ci->BIZ_order->get_guestlist(implode(',',$g_cold_str));
|
|
|
|
|
$from_country = current(array_filter(array_map(function ($ele){return $ele->Country;},$guestlist)));
|
|
|
|
|
// 联系人
|
|
|
|
|
$biz_contact = $this->ci->BIZ_order->get_customer_contact(implode(',',$g_cold_str));
|
|
|
|
|
$guestlist[0]->phone = $biz_contact->phone;
|
|
|
|
|
if (strval($from_country)==='') {
|
|
|
|
|
$from_country = $biz_contact->Country;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
foreach ($guestlist as $key => $vg) {
|
|
|
|
|
$this_otherinfo = "";
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
|
|
|
|
|
->setCustomersPeopleType($key, (calc_age_type($vg->BirthDay)==1 ? "成人" : "儿童"))
|
|
|
|
|
->setCustomersDocumentType($key, "护照") // Passport No.
|
|
|
|
|
->setCustomersDocumentNo($key, $vg->PassportNo)
|
|
|
|
|
->setCustomersOtherInfo($key, $vg->Country . "; " . $vg->phone);
|
|
|
|
|
->setCustomersPhoneNo($key, $vg->phone);
|
|
|
|
|
if (strval($vg->Country) !== '') {
|
|
|
|
|
$this_otherinfo .= $vg->Country;
|
|
|
|
|
$from_country = strval($from_country) === '' ? $vg->Country : $from_country;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->Gender) !== '') {
|
|
|
|
|
$this_otherinfo .= "; " . $vg->Gender;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->BirthDay) !== '') {
|
|
|
|
|
$this_otherinfo .= "; 生日:". $vg->BirthDay;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->PassportValidDate) !== '') {
|
|
|
|
|
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
|
|
|
|
|
}
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
|
|
|
|
|
}
|
|
|
|
|
// 客源地
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
|
|
|
|
|
// 补全空的日期,行程为空
|
|
|
|
|
$date1 = new DateTime($first_date);
|
|
|
|
|
$date_end = new DateTime($end_date);
|
|
|
|
@ -245,12 +283,21 @@ class Tulanduo
|
|
|
|
|
->setScheduleDetailsContent($kd,
|
|
|
|
|
$vgrd->GRD_LeaveCity . "-" . $vgrd->GRD_ServiceCity . "\r\n" .
|
|
|
|
|
$vgrd->GRD_Landscape . "\r\n" . $vgrd->GRD_Traffic)
|
|
|
|
|
->setScheduleDetailsAccommodation($kd, $vgrd->GRD_Hotel)
|
|
|
|
|
->setScheduleDetailsTraffic($kd, ($vgrd->GRD_Traffic))
|
|
|
|
|
->setScheduleDetailsBreakFirst($kd, 0 )
|
|
|
|
|
->setScheduleDetailsDinner($kd, (trim($vgrd->GRD_Meal_S)==="" ? 0 : 1 ))
|
|
|
|
|
->setScheduleDetailsLunch($kd, (trim($vgrd->GRD_Meal_L)==="" ? 0 : 1 ))
|
|
|
|
|
;
|
|
|
|
|
// 酒店只写名字在线路信息中
|
|
|
|
|
if (isset($vgrd->hotel_name) && strval($vgrd->hotel_name)!=='') {
|
|
|
|
|
$this->ci->tldOrderBuilder->setScheduleDetailsAccommodation($kd, $vgrd->hotel_name);
|
|
|
|
|
} else {
|
|
|
|
|
$this->ci->tldOrderBuilder->setScheduleDetailsAccommodation($kd, $vgrd->GRD_Hotel);
|
|
|
|
|
}
|
|
|
|
|
if (strval($vgrd->GRD_Hotel) !=='' ) {
|
|
|
|
|
$this->ci->tldOrderBuilder->setRoomStandard($vgrd->GRD_OrderDate . " " . trim($vgrd->GRD_Hotel));
|
|
|
|
|
}
|
|
|
|
|
// 商务订单信息
|
|
|
|
|
if (isset($vgrd->hotel_checkin)) {
|
|
|
|
|
$this->ci->tldOrderBuilder->setRoomStandard(trim($vgrd->hotel_checkin));
|
|
|
|
|
}
|
|
|
|
@ -405,7 +452,7 @@ class Tulanduo
|
|
|
|
|
}
|
|
|
|
|
if ( ! empty($train_coldsn_arr)) {
|
|
|
|
|
$route_name .= $route_name==="" ? "" : "+";
|
|
|
|
|
$route_name .= "火车票预订";
|
|
|
|
|
$route_name .= "单订国际列车票服务";
|
|
|
|
|
$order_type = 1;
|
|
|
|
|
$train_order = $this->ci->BIZ_order->get_train_flight_order(implode(',', $train_coldsn_arr));
|
|
|
|
|
$agcOrderNo = $vas->GRI_Name;
|
|
|
|
@ -416,7 +463,7 @@ class Tulanduo
|
|
|
|
|
->setKey($userKey)
|
|
|
|
|
->setOrderType($order_type)
|
|
|
|
|
->setRouteName($route_name)
|
|
|
|
|
->setRouteType("火车票预订")
|
|
|
|
|
->setRouteType("单订国际列车票服务")
|
|
|
|
|
->setAgcOrderNo($agcOrderNo)
|
|
|
|
|
->setAdultNum($train_order[0]->adult_num)
|
|
|
|
|
->setChildNum($train_order[0]->child_num)
|
|
|
|
@ -426,14 +473,28 @@ class Tulanduo
|
|
|
|
|
;
|
|
|
|
|
$train_guest_list = $this->ci->BIZ_order->get_guestlist(implode(',', $train_coldsn_arr));
|
|
|
|
|
// 客人列表
|
|
|
|
|
$from_country = ""; // 客源地
|
|
|
|
|
foreach ($train_guest_list as $key => $vg) {
|
|
|
|
|
$this_otherinfo = "";
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName )
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
|
|
|
|
|
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
|
|
|
|
|
->setCustomersDocumentType($key, "护照") // Passport No.
|
|
|
|
|
->setCustomersDocumentNo($key, $vg->BPE_Passport)
|
|
|
|
|
->setCustomersDocumentNo($key, $vg->PassportNo)
|
|
|
|
|
;
|
|
|
|
|
$this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
|
|
|
|
|
if (strval($vg->Country) !== '' ) {
|
|
|
|
|
$from_country = strval($from_country) === '' ? $vg->Country : $from_country;
|
|
|
|
|
$this_otherinfo .= $vg->Country;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->Gender) !== '') {
|
|
|
|
|
$this_otherinfo .= "; " . $vg->Gender;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->BirthDay) !== '') {
|
|
|
|
|
$this_otherinfo .= "; 生日:". $vg->BirthDay;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->PassportValidDate) !== '') {
|
|
|
|
|
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
|
|
|
|
|
}
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
|
|
|
|
|
// todo:电话
|
|
|
|
|
// if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
|
|
|
|
|
// $this_otherinfo .= "; 电话:";
|
|
|
|
@ -442,6 +503,7 @@ class Tulanduo
|
|
|
|
|
// $this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
|
|
|
|
|
$s_index = 0;
|
|
|
|
|
foreach ($train_order as $train) {
|
|
|
|
|
$this_content = '';
|
|
|
|
@ -704,21 +766,40 @@ class Tulanduo
|
|
|
|
|
// ->setBackTraffic($backTraffic)
|
|
|
|
|
;
|
|
|
|
|
// 客人列表
|
|
|
|
|
$from_country = '';
|
|
|
|
|
foreach ($guestlist as $key => $vg) {
|
|
|
|
|
$this_otherinfo = "";
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName )
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
|
|
|
|
|
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
|
|
|
|
|
->setCustomersDocumentType($key, "护照") // Passport No.
|
|
|
|
|
->setCustomersDocumentNo($key, $vg->BPE_Passport)
|
|
|
|
|
->setCustomersDocumentNo($key, $vg->PassportNo)
|
|
|
|
|
;
|
|
|
|
|
$this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
|
|
|
|
|
if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
|
|
|
|
|
$this_otherinfo .= "; 电话:";
|
|
|
|
|
$this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ;
|
|
|
|
|
$this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL);
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersPhoneNo($key, $this_otherinfo);
|
|
|
|
|
}
|
|
|
|
|
if ( strval($vg->Country) !== '') {
|
|
|
|
|
$from_country = strval($from_country) === '' ? $vg->Country : $from_country;
|
|
|
|
|
$this_otherinfo .= "; " . $vg->Country;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->Gender) !== '') {
|
|
|
|
|
$this_otherinfo .= "; " . $vg->Gender;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->BirthDay) !== '') {
|
|
|
|
|
$this_otherinfo .= "; 生日:". $vg->BirthDay;
|
|
|
|
|
}
|
|
|
|
|
if (strval($vg->PassportValidDate) !== '') {
|
|
|
|
|
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
|
|
|
|
|
}
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
|
|
|
|
|
}
|
|
|
|
|
// 客源地
|
|
|
|
|
if (strval($from_country)==='') {
|
|
|
|
|
$biz_contact = $this->ci->BIZ_order->get_customer_contact($COLD_SN_str);
|
|
|
|
|
$from_country = $biz_contact->Country;
|
|
|
|
|
}
|
|
|
|
|
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
|
|
|
|
|
$scheduleDetails = $this->ci->BIZ_order->get_scheduleDetails($COLD_SN_str);
|
|
|
|
|
$schedule_obj = array();
|
|
|
|
|
foreach ($scheduleDetails as $ks => $vs) {
|
|
|
|
@ -872,7 +953,7 @@ class Tulanduo
|
|
|
|
|
->setTravelFeesRemark($fee_index, "代收; " . $replace_collections->ALL_Memo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 查询是否变更 TODO: deprecated
|
|
|
|
|
// 查询是否变更 deprecated
|
|
|
|
|
$sync_orderstate = 10;
|
|
|
|
|
$vps_sn = 0;
|
|
|
|
|
$vendor_orderid = 0;
|
|
|
|
|