diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 43d75ab8..2945d33c 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -213,17 +213,28 @@ class Tulanduo // ->setRoomStandard($request_info->GCI_HotelRequest) // 住房标准 ->setRouteStandard($request_info->GCI_Request) // 行程服务标准 ; + $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))); + if (strval($from_country)==='') { + $biz_contact = $this->ci->BIZ_order->get_customer_contact(implode(',',$g_cold_str)); + $from_country = $biz_contact->Country; + } } foreach ($guestlist as $key => $vg) { $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) !== '' && strval($from_country) === '') { + $from_country = $vg->Country; + } } + // 客源地 + $this->ci->tldOrderBuilder->setCustomerFromCity($from_country); // 补全空的日期,行程为空 $date1 = new DateTime($first_date); $date_end = new DateTime($end_date); @@ -433,14 +444,18 @@ 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_otherinfo = ""; + $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) !== '' && strval($from_country) === '') { + $from_country = $vg->Country; + } + // $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality); // todo:电话 // if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) { // $this_otherinfo .= "; 电话:"; @@ -449,6 +464,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 = ''; @@ -711,21 +727,28 @@ 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->setCustomersOtherInfo($key, $this_otherinfo); + $this->ci->tldOrderBuilder->setCustomersPhoneNo($key, $this_otherinfo); } + if (strval($from_country) === '' && strval($vg->Country) !== '') { + $from_country = $vg->Country; + } + } + 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) { diff --git a/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php b/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php index 09d6f87a..75a36fa5 100644 --- a/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php +++ b/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php @@ -381,4 +381,30 @@ class BIZ_Orders_model extends CI_Model { where p.PAGS_SN=$PAGS_SN "; return $this->HT->query($sql)->row(); } + + /*! + * @Author: LYT + * @Date: 2019-06-25 10:12:52 + * @Desc: 商务订单联系人信息 + */ + public function get_customer_contact($COLD_SN_str) + { + $sql = "SELECT + GUT_FirstName + ' '+GUT_LastName as MemberName, + '' as BirthDay, + '' as Gender, + GUT_MoveTel as phone, + (select COI2_Country from V_Country_Info + where LGC_LGC = 2 + and COI_SN = GUT_NationalityID + ) as Country, + GUT_Passport as PassportNo, + '' as PassportValidDate + --,BIZ_GUEST.* + from BIZ_GUEST + inner join BIZ_ConfirmLineInfo on COLI_GUT_SN=GUT_SN + inner join BIZ_ConfirmLineDetail on COLI_SN=COLD_COLI_SN + where COLD_SN IN ($COLD_SN_str) "; + return $this->HT->query($sql)->row(); + } } diff --git a/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php b/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php index bf27da86..04d57bb4 100644 --- a/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php +++ b/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php @@ -146,6 +146,16 @@ class TuLanDuo_addOrUpdateRouteOrderContentBuilder extends CI_Model $this->orderData['leavedDate'] = $leavedDate; return $this; } + public function setOperationUserName($operationUserName) + { + $this->orderData['operationUserName'] = $operationUserName; + return $this; + } + public function setCustomerFromCity($customerFromCity) + { + $this->orderData['customerFromCity'] = $customerFromCity; + return $this; + } /** 团款数组 */ public function setTravelFeesType($index, $type)