diff --git a/webht/third_party/vendorPlanSync/controllers/index.php b/webht/third_party/vendorPlanSync/controllers/index.php index 0feb4228..a9f8da3e 100644 --- a/webht/third_party/vendorPlanSync/controllers/index.php +++ b/webht/third_party/vendorPlanSync/controllers/index.php @@ -24,13 +24,13 @@ class Index extends CI_Controller { * * 使用供应商平台登陆账号获取接口的key */ - public function index($GRI_SN=0, $vendor=null) + public function index($GRI_SN=0, $vendor=null, $set_pvt=0) { $auto_vendor_str = $vendor===null ? implode(",", $this->vendor->auto_vendor) : $vendor; - return $this->push($GRI_SN, $auto_vendor_str); + return $this->push($GRI_SN, $auto_vendor_str, $set_pvt); } - public function push($GRI_SN=0, $vendor_str=null) + public function push($GRI_SN=0, $vendor_str=null, $set_pvt=0) { $start_date = date('Y-m-d'); $end_date = date('Y-m-d 23:59:59', strtotime("+2 months")); @@ -43,7 +43,7 @@ class Index extends CI_Controller { $vendor_class = $this->vendor->vendor_fun[strval($order->VAS_VEI_SN)]; $this->load->library($vendor_class); $vendor_class_name = mb_strtolower($vendor_class); - $call_fun = $this->$vendor_class_name->order_push($order); + $call_fun = $this->$vendor_class_name->order_push($order, $set_pvt); log_message('error',"Call [$vendor_class>order_push] " . $order->GRI_SN . ". " . $call_fun); return $this->output->set_output($call_fun . ". " . $order->GRI_SN); } diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 494a9460..4ecf5e32 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -74,7 +74,7 @@ class Tulanduo $this->vendor_ids = array(1343,30548,29188); } - public function order_push($order=null) + public function order_push($order=null, $set_pvt=0) { // 初始化所有Trippest合作项目的包价产品 $this->tulanduo_trippest_pag = $this->ci->BIZ_order->get_packageDetails('', implode(',', $this->vendor_ids)); @@ -87,11 +87,11 @@ class Tulanduo } // 商务 if (strval($order->GRI_OrderType) === "227002") { - return $this->push_biz($order); + return $this->push_biz($order, $set_pvt); } // 传统订单 if (strval($order->GRI_OrderType) === "227001") { - return $this->push_tour($order); + return $this->push_tour($order, $set_pvt); } return "[Tulanduo>order_push] No function match. "; @@ -100,7 +100,7 @@ class Tulanduo /*! * 发送线路订单计划 */ - public function push_tour($vas=null) + public function push_tour($vas=null, $set_pvt=0) { $gri_sn = $vas->GRI_SN; $vas_sn = $vas->VAS_SN; @@ -127,7 +127,7 @@ class Tulanduo } $reduce_package_code = array_filter($reduce_package_code); */ - $grd_apart_info = $this->tour_apart($grd_info); + $grd_apart_info = $this->tour_apart($grd_info, $set_pvt); $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) { @@ -246,7 +246,7 @@ class Tulanduo $this_otherinfo .= "; " . $vg->Gender; } if (strval($vg->BirthDay) !== '') { - $this_otherinfo .= "; 生日:". $vg->BirthDay . "; " . calc_age($vg->BirthDay) . "岁"; + $this_otherinfo .= "; 生日:". substr($vg->BirthDay,0,10) . "; " . calc_age($vg->BirthDay) . "岁"; } if (strval($vg->PassportValidDate) !== '') { $this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate; @@ -317,6 +317,7 @@ class Tulanduo $sync_orderstate = 10; $set_update = false; $this->ci->tldOrderBuilder->clearModifyLogInfo(); + // echo $this->ci->tldOrderBuilder->getBizContent();exit; $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder); $response = json_decode($resp); if ($response->status == 1) { @@ -353,7 +354,7 @@ class Tulanduo * ) * ) */ - public function tour_apart($all_pag_info) + public function tour_apart($all_pag_info, $set_pvt=0) { $apart = array(); $ret = array(); foreach ($all_pag_info as $key => $pag) { @@ -379,7 +380,7 @@ class Tulanduo } // 合作的产品 // 商务订单全部按PVT || isset($pag->is_biz) - if ($this->ci->trippest->if_tour_pvt(array($pag))===1) { + if ($this->ci->trippest->if_tour_pvt(array($pag))===1 || $set_pvt!==0) { $apart["pvt"]['details'][] = $pag; } else { $apart["com"]['details'][$pag->PAG_Code][] = $pag; @@ -429,7 +430,7 @@ class Tulanduo * @Date: 2019-06-04 11:47:38 * @Desc: 发送商务订单计划 */ - public function push_biz($vas=null) + public function push_biz($vas=null, $set_pvt=0) { $userId = $this->send_host["1"]["userId"]; $userKey = $this->send_host["1"]["key"]; @@ -556,12 +557,12 @@ class Tulanduo } } if ( ! empty($pag_coldsn_arr)) { - $this->biz_pag_order_exec($vas,$grd_info); + $this->biz_pag_order_exec($vas,$grd_info, $set_pvt); } return false; } - private function biz_pag_order_exec($vas, $grd) + private function biz_pag_order_exec($vas, $grd, $set_pvt=0) { if (empty($grd)) { return false; @@ -629,7 +630,7 @@ class Tulanduo } $complete_grd = array_merge($special_grd, $normal_grd); $complete_grd = json_decode(json_encode($complete_grd)); - $grd_apart_info = $this->tour_apart($complete_grd); + $grd_apart_info = $this->tour_apart($complete_grd, $set_pvt); // echo json_encode($grd_apart_info);exit; $request_info = $this->ci->Group_model->get_plan_request($vas->GRI_SN); $big_order_index = 0;