|
|
@ -5,8 +5,10 @@ if (!defined('BASEPATH'))
|
|
|
|
|
|
|
|
|
|
|
|
GLOBAL $__HAINA_VEI__;
|
|
|
|
GLOBAL $__HAINA_VEI__;
|
|
|
|
|
|
|
|
|
|
|
|
class Tulanduo extends CI_Controller
|
|
|
|
class Tulanduo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
protected $ci;
|
|
|
|
|
|
|
|
|
|
|
|
/** Live */
|
|
|
|
/** Live */
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
目的地
|
|
|
|
目的地
|
|
|
@ -55,17 +57,17 @@ class Tulanduo extends CI_Controller
|
|
|
|
// public $neworder_url = "http://djb3c.ltsoftware.net:9921/action/api/addOrUpdateRouteOrder/";
|
|
|
|
// public $neworder_url = "http://djb3c.ltsoftware.net:9921/action/api/addOrUpdateRouteOrder/";
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct(){
|
|
|
|
public function __construct(){
|
|
|
|
parent::__construct();
|
|
|
|
$this->ci =& get_instance();
|
|
|
|
mb_regex_encoding("UTF-8");
|
|
|
|
mb_regex_encoding("UTF-8");
|
|
|
|
bcscale(4);
|
|
|
|
bcscale(4);
|
|
|
|
$GLOBALS['__HAINA_VEI__'] = 30561;
|
|
|
|
$GLOBALS['__HAINA_VEI__'] = 30561;
|
|
|
|
$this->load->helper('array');
|
|
|
|
$this->ci->load->helper('array');
|
|
|
|
$this->load->library('trippest');
|
|
|
|
$this->ci->load->library('trippest');
|
|
|
|
$this->load->model('Group_model');
|
|
|
|
$this->ci->load->model('Group_model');
|
|
|
|
$this->load->model('orders_model');
|
|
|
|
$this->ci->load->model('orders_model');
|
|
|
|
$this->load->model('BIZ_orders_model', 'BIZ_order');
|
|
|
|
$this->ci->load->model('BIZ_orders_model', 'BIZ_order');
|
|
|
|
$this->load->model('TuLanDuo_queryContentBuilder', 'tld_order');
|
|
|
|
$this->ci->load->model('TuLanDuo_queryContentBuilder', 'tld_order');
|
|
|
|
$this->load->model('TuLanDuo_addOrUpdateRouteOrderContentBuilder', 'tldOrderBuilder');
|
|
|
|
$this->ci->load->model('TuLanDuo_addOrUpdateRouteOrderContentBuilder', 'tldOrderBuilder');
|
|
|
|
// $this->output->enable_profiler(TRUE);
|
|
|
|
// $this->output->enable_profiler(TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
$this->vendor_ids = array(1343,30548,29188);
|
|
|
|
$this->vendor_ids = array(1343,30548,29188);
|
|
|
@ -262,13 +264,13 @@ class Tulanduo extends CI_Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$change_info = str_replace("\n", "<br>", $change_info);
|
|
|
|
$change_info = str_replace("\n", "<br>", $change_info);
|
|
|
|
$vei_sn_str = implode(",", $this->vendor_ids);
|
|
|
|
$vei_sn_str = implode(",", $this->vendor_ids);
|
|
|
|
$orderinfo = $this->BIZ_order->get_orderinfo_detail($gri_sn, $vei_sn_str);
|
|
|
|
$orderinfo = $this->ci->BIZ_order->get_orderinfo_detail($gri_sn, $vei_sn_str);
|
|
|
|
if(empty($orderinfo)) {return "[Tulanduo>push_trippest] Not found order detail. ";}
|
|
|
|
if(empty($orderinfo)) {return "[Tulanduo>push_trippest] Not found order detail. ";}
|
|
|
|
$COLI_ID = $orderinfo[0]->COLI_ID;
|
|
|
|
$COLI_ID = $orderinfo[0]->COLI_ID;
|
|
|
|
$set_pvt = strval($orderinfo[0]->is_pvt);
|
|
|
|
$set_pvt = strval($orderinfo[0]->is_pvt);
|
|
|
|
// 增加收款方参数, 增加代收款项
|
|
|
|
// 增加收款方参数, 增加代收款项
|
|
|
|
$vei_with_haina = $GLOBALS['__HAINA_VEI__'] . "," . $vei_sn_str;
|
|
|
|
$vei_with_haina = $GLOBALS['__HAINA_VEI__'] . "," . $vei_sn_str;
|
|
|
|
$all_payment = $this->BIZ_order->get_paymentDetails($COLI_ID, $vei_with_haina);
|
|
|
|
$all_payment = $this->ci->BIZ_order->get_paymentDetails($COLI_ID, $vei_with_haina);
|
|
|
|
$paid_to_trippest = array();
|
|
|
|
$paid_to_trippest = array();
|
|
|
|
$pay_to_vendor = array();
|
|
|
|
$pay_to_vendor = array();
|
|
|
|
foreach ($all_payment as $kall => $vall) {
|
|
|
|
foreach ($all_payment as $kall => $vall) {
|
|
|
@ -281,18 +283,18 @@ class Tulanduo extends CI_Controller
|
|
|
|
// 收款合并为一条
|
|
|
|
// 收款合并为一条
|
|
|
|
$travel_fees = new stdClass();
|
|
|
|
$travel_fees = new stdClass();
|
|
|
|
$travel_fees = $paid_to_trippest[0];
|
|
|
|
$travel_fees = $paid_to_trippest[0];
|
|
|
|
$travel_fees->GAI_SSJE = 0;
|
|
|
|
$travel_fees->SUM_SSJE = 0;
|
|
|
|
foreach ($paid_to_trippest as $ktf => $vtf) {
|
|
|
|
foreach ($paid_to_trippest as $ktf => $vtf) {
|
|
|
|
$travel_fees->GAI_SSJE = bcadd($travel_fees->GAI_SSJE, $vtf->GAI_SSJE);
|
|
|
|
$travel_fees->SUM_SSJE = bcadd($travel_fees->SUM_SSJE, $vtf->GAI_SSJE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 代收合并为一条
|
|
|
|
// 代收合并为一条
|
|
|
|
$replace_collections = new stdClass();
|
|
|
|
$replace_collections = new stdClass();
|
|
|
|
$replace_collections = $pay_to_vendor[0];
|
|
|
|
$replace_collections = $pay_to_vendor[0];
|
|
|
|
$replace_collections->GAI_SSJE = 0;
|
|
|
|
$replace_collections->SUM_SSJE = 0;
|
|
|
|
$replace_collections->GAI_Memo = "";
|
|
|
|
$replace_collections->ALL_Memo = "";
|
|
|
|
foreach ($pay_to_vendor as $ktv => $vtv) {
|
|
|
|
foreach ($pay_to_vendor as $ktv => $vtv) {
|
|
|
|
$replace_collections->GAI_SSJE = bcadd($replace_collections->GAI_SSJE, $vtv->GAI_SSJE);
|
|
|
|
$replace_collections->SUM_SSJE = bcadd($replace_collections->SUM_SSJE, $vtv->GAI_SSJE);
|
|
|
|
$replace_collections->GAI_Memo .= $vtv->GAI_Memo;
|
|
|
|
$replace_collections->ALL_Memo .= $vtv->ALL_Memo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 按产品拆分 按订单类型拆分? 单团/拼团; 未设置则按产品类型:接送
|
|
|
|
// 按产品拆分 按订单类型拆分? 单团/拼团; 未设置则按产品类型:接送
|
|
|
|
$fill_order = array();
|
|
|
|
$fill_order = array();
|
|
|
@ -301,8 +303,8 @@ class Tulanduo extends CI_Controller
|
|
|
|
foreach ($orderinfo as $ko => $cold) {
|
|
|
|
foreach ($orderinfo as $ko => $cold) {
|
|
|
|
if ( ! in_array($cold->COLD_SN, $processed_cold) && $cold->pag_code != '') {
|
|
|
|
if ( ! in_array($cold->COLD_SN, $processed_cold) && $cold->pag_code != '') {
|
|
|
|
$processed_cold[] = $cold->COLD_SN;
|
|
|
|
$processed_cold[] = $cold->COLD_SN;
|
|
|
|
$all_package = $this->trippest->tour_code($cold->pag_code);
|
|
|
|
$all_package = $this->ci->trippest->tour_code($cold->pag_code);
|
|
|
|
$pag_info = $this->BIZ_order->get_packageDetails(my_implode("'",",",$all_package));
|
|
|
|
$pag_info = $this->ci->BIZ_order->get_packageDetails(my_implode("'",",",$all_package));
|
|
|
|
if ($set_pvt==='1') {
|
|
|
|
if ($set_pvt==='1') {
|
|
|
|
$fill_order[0]["cold"][] = $cold;
|
|
|
|
$fill_order[0]["cold"][] = $cold;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -315,10 +317,10 @@ class Tulanduo extends CI_Controller
|
|
|
|
$pvt_pagcode = array();
|
|
|
|
$pvt_pagcode = array();
|
|
|
|
if ($set_pvt==='1') {
|
|
|
|
if ($set_pvt==='1') {
|
|
|
|
foreach ($fill_order[0]['cold'] as $kcd => $vcd) {
|
|
|
|
foreach ($fill_order[0]['cold'] as $kcd => $vcd) {
|
|
|
|
$multi_package = $this->trippest->tour_code($vcd->pag_code);
|
|
|
|
$multi_package = $this->ci->trippest->tour_code($vcd->pag_code);
|
|
|
|
$pvt_pagcode = array_merge($pvt_pagcode, $multi_package);
|
|
|
|
$pvt_pagcode = array_merge($pvt_pagcode, $multi_package);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$fill_order[0]["package_info"] = $this->BIZ_order->get_packageDetails(my_implode("'",",",$pvt_pagcode));
|
|
|
|
$fill_order[0]["package_info"] = $this->ci->BIZ_order->get_packageDetails(my_implode("'",",",$pvt_pagcode));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// $fill_order = array_values($fill_order);
|
|
|
|
// $fill_order = array_values($fill_order);
|
|
|
|
$i=0;
|
|
|
|
$i=0;
|
|
|
@ -327,7 +329,7 @@ class Tulanduo extends CI_Controller
|
|
|
|
foreach ($fill_order as $kf => $vf) {
|
|
|
|
foreach ($fill_order as $kf => $vf) {
|
|
|
|
$i++;
|
|
|
|
$i++;
|
|
|
|
$coli_sn = $vf['cold'][0]->COLI_SN;
|
|
|
|
$coli_sn = $vf['cold'][0]->COLI_SN;
|
|
|
|
$this->tldOrderBuilder->resetBizContent();
|
|
|
|
$this->ci->tldOrderBuilder->resetBizContent();
|
|
|
|
$order_type = $set_pvt;
|
|
|
|
$order_type = $set_pvt;
|
|
|
|
if ($set_pvt==='0') {
|
|
|
|
if ($set_pvt==='0') {
|
|
|
|
$code_type_arr = array_map(function($pag) { return intval($pag->PAG_ExtendType); }, $vf["package_info"]);
|
|
|
|
$code_type_arr = array_map(function($pag) { return intval($pag->PAG_ExtendType); }, $vf["package_info"]);
|
|
|
@ -335,13 +337,13 @@ class Tulanduo extends CI_Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$last_code = count($vf["package_info"])-1;
|
|
|
|
$last_code = count($vf["package_info"])-1;
|
|
|
|
$last_date = count($vf["cold"])-1;
|
|
|
|
$last_date = count($vf["cold"])-1;
|
|
|
|
$tour_code = "";
|
|
|
|
$tour_code = mb_strtoupper($vf["cold"][0]->pag_code);
|
|
|
|
$routeName = $vf["package_info"][0]->PAG2_Name . "(" . mb_strtoupper($vf["cold"][0]->pag_code) . ")";
|
|
|
|
$routeName = $vf["package_info"][0]->PAG2_Name . "(" . $tour_code . ")";
|
|
|
|
$first_date = strstr($vf["cold"][0]->COLD_StartDate, " ", true);
|
|
|
|
$first_date = strstr($vf["cold"][0]->COLD_StartDate, " ", true);
|
|
|
|
$end_date = strstr($vf["cold"][$last_date]->COLD_EndDate, " ", true);
|
|
|
|
$end_date = strstr($vf["cold"][$last_date]->COLD_EndDate, " ", true);
|
|
|
|
if (isset($this->trippest->special_route[$vf["cold"][0]->pag_code])) {
|
|
|
|
if (isset($this->ci->trippest->special_route[$vf["cold"][0]->pag_code])) {
|
|
|
|
$routeName = $this->trippest->special_route[$vf["cold"][0]->pag_code]["name"];
|
|
|
|
$routeName = $this->ci->trippest->special_route[$vf["cold"][0]->pag_code]["name"];
|
|
|
|
$extra_day = $this->trippest->special_route[$vf["cold"][0]->pag_code]["day"]-1;
|
|
|
|
$extra_day = $this->ci->trippest->special_route[$vf["cold"][0]->pag_code]["day"]-1;
|
|
|
|
$end_date = date("Y-m-d", strtotime("+$extra_day day", strtotime($vf["cold"][0]->COLD_StartDate)));
|
|
|
|
$end_date = date("Y-m-d", strtotime("+$extra_day day", strtotime($vf["cold"][0]->COLD_StartDate)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$agcOrderNo = $vf["cold"][0]->COLI_GroupCode . "-" . $vf["package_info"][0]->city_code;
|
|
|
|
$agcOrderNo = $vf["cold"][0]->COLI_GroupCode . "-" . $vf["package_info"][0]->city_code;
|
|
|
@ -357,8 +359,8 @@ class Tulanduo extends CI_Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$COLD_SN_str = implode(',', array_map( function($element){return $element->COLD_SN;}, $vf["cold"] )) ;
|
|
|
|
$COLD_SN_str = implode(',', array_map( function($element){return $element->COLD_SN;}, $vf["cold"] )) ;
|
|
|
|
$guestlist = $this->BIZ_order->get_guestlist($COLD_SN_str);
|
|
|
|
$guestlist = $this->ci->BIZ_order->get_guestlist($COLD_SN_str);
|
|
|
|
$this->tldOrderBuilder->setUserId($userId)
|
|
|
|
$this->ci->tldOrderBuilder->setUserId($userId)
|
|
|
|
->setKey($userKey)
|
|
|
|
->setKey($userKey)
|
|
|
|
->setOrderType($order_type)
|
|
|
|
->setOrderType($order_type)
|
|
|
|
->setRouteName($routeName)
|
|
|
|
->setRouteName($routeName)
|
|
|
@ -377,22 +379,22 @@ class Tulanduo extends CI_Controller
|
|
|
|
// 客人列表
|
|
|
|
// 客人列表
|
|
|
|
foreach ($guestlist as $key => $vg) {
|
|
|
|
foreach ($guestlist as $key => $vg) {
|
|
|
|
$this_otherinfo = "";
|
|
|
|
$this_otherinfo = "";
|
|
|
|
$this->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName )
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName )
|
|
|
|
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
|
|
|
|
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
|
|
|
|
->setCustomersDocumentType($key, "护照") // Passport No.
|
|
|
|
->setCustomersDocumentType($key, "护照") // Passport No.
|
|
|
|
->setCustomersDocumentNo($key, $vg->BPE_Passport)
|
|
|
|
->setCustomersDocumentNo($key, $vg->BPE_Passport)
|
|
|
|
// ->setCustomersOtherInfo($key, $this->BIZ_order->GetNationalityName($vg->BPE_Nationality))
|
|
|
|
// ->setCustomersOtherInfo($key, $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality))
|
|
|
|
;
|
|
|
|
;
|
|
|
|
$this_otherinfo .= $this->BIZ_order->GetNationalityName($vg->BPE_Nationality);
|
|
|
|
$this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
|
|
|
|
if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
|
|
|
|
if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
|
|
|
|
// $order_remark = "预定人电话:" . trim($vf["cold"][0]->GUT_TEL);
|
|
|
|
// $order_remark = "预定人电话:" . trim($vf["cold"][0]->GUT_TEL);
|
|
|
|
$this_otherinfo .= "; 电话:";
|
|
|
|
$this_otherinfo .= "; 电话:";
|
|
|
|
$this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ;
|
|
|
|
$this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ;
|
|
|
|
$this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL);
|
|
|
|
$this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL);
|
|
|
|
$this->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
|
|
|
|
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scheduleDetails = $this->BIZ_order->get_scheduleDetails($COLD_SN_str);
|
|
|
|
$scheduleDetails = $this->ci->BIZ_order->get_scheduleDetails($COLD_SN_str);
|
|
|
|
$schedule_obj = array();
|
|
|
|
$schedule_obj = array();
|
|
|
|
foreach ($scheduleDetails as $ks => $vs) {
|
|
|
|
foreach ($scheduleDetails as $ks => $vs) {
|
|
|
|
$schedule_obj[substr($vs->COLD_StartDate, 0, 10)]['date'] = substr($vs->COLD_StartDate, 0, 10);
|
|
|
|
$schedule_obj[substr($vs->COLD_StartDate, 0, 10)]['date'] = substr($vs->COLD_StartDate, 0, 10);
|
|
|
@ -415,7 +417,7 @@ class Tulanduo extends CI_Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this_content .= substr($this_guest, 1);
|
|
|
|
$this_content .= substr($this_guest, 1);
|
|
|
|
// 酒店
|
|
|
|
// 酒店
|
|
|
|
$hotels = $this->BIZ_order->get_package_order($vs->COLD_SN);
|
|
|
|
$hotels = $this->ci->BIZ_order->get_package_order($vs->COLD_SN);
|
|
|
|
if (trim($hotels[0]->POI_HotelAddress) != "") {
|
|
|
|
if (trim($hotels[0]->POI_HotelAddress) != "") {
|
|
|
|
$this_content .= "\r\n酒店地址:" . $hotels[0]->POI_HotelAddress;
|
|
|
|
$this_content .= "\r\n酒店地址:" . $hotels[0]->POI_HotelAddress;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -437,16 +439,16 @@ class Tulanduo extends CI_Controller
|
|
|
|
$schedule_obj[substr($vs->COLD_StartDate, 0, 10)]['accommodation'] = $hotels[0]->POI_Hotel;
|
|
|
|
$schedule_obj[substr($vs->COLD_StartDate, 0, 10)]['accommodation'] = $hotels[0]->POI_Hotel;
|
|
|
|
// 补充行程
|
|
|
|
// 补充行程
|
|
|
|
$fill_date = array();
|
|
|
|
$fill_date = array();
|
|
|
|
if (isset($this->trippest->special_route[$vs->PAG_Code])) {
|
|
|
|
if (isset($this->ci->trippest->special_route[$vs->PAG_Code])) {
|
|
|
|
for ($j=0; $j < $this->trippest->special_route[$vs->PAG_Code]['day']; $j++) {
|
|
|
|
for ($j=0; $j < $this->ci->trippest->special_route[$vs->PAG_Code]['day']; $j++) {
|
|
|
|
$e_day = date("Y-m-d", strtotime("+$j day", strtotime($vs->COLD_StartDate)));
|
|
|
|
$e_day = date("Y-m-d", strtotime("+$j day", strtotime($vs->COLD_StartDate)));
|
|
|
|
if ( ! isset($schedule_obj[$e_day]['content'])) {
|
|
|
|
if ( ! isset($schedule_obj[$e_day]['content'])) {
|
|
|
|
$schedule_obj[$e_day]['content'] = "";
|
|
|
|
$schedule_obj[$e_day]['content'] = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$schedule_obj[$e_day]['date'] = $e_day;
|
|
|
|
$schedule_obj[$e_day]['date'] = $e_day;
|
|
|
|
$fill_date[] = $e_day;
|
|
|
|
$fill_date[] = $e_day;
|
|
|
|
$schedule_obj[$e_day]['code'] = $this->trippest->special_route[$vs->PAG_Code]['code'][$j];
|
|
|
|
$schedule_obj[$e_day]['code'] = $this->ci->trippest->special_route[$vs->PAG_Code]['code'][$j];
|
|
|
|
$pag_detail = $this->BIZ_order->get_packageDetails("'" . $schedule_obj[$e_day]['code'] . "'");
|
|
|
|
$pag_detail = $this->ci->BIZ_order->get_packageDetails("'" . $schedule_obj[$e_day]['code'] . "'");
|
|
|
|
$schedule_obj[$e_day]['title'] = $pag_detail[0]->PAG2_Name;
|
|
|
|
$schedule_obj[$e_day]['title'] = $pag_detail[0]->PAG2_Name;
|
|
|
|
$schedule_obj[$e_day]['lunch'] = (in_array($pag_detail[0]->PAG_Meal, array('61002', '61004')) ? 1 : 0);
|
|
|
|
$schedule_obj[$e_day]['lunch'] = (in_array($pag_detail[0]->PAG_Meal, array('61002', '61004')) ? 1 : 0);
|
|
|
|
$schedule_obj[$e_day]['dinner'] = (in_array($pag_detail[0]->PAG_Meal, array('61003', '61004')) ? 1 : 0);
|
|
|
|
$schedule_obj[$e_day]['dinner'] = (in_array($pag_detail[0]->PAG_Meal, array('61003', '61004')) ? 1 : 0);
|
|
|
@ -490,7 +492,7 @@ class Tulanduo extends CI_Controller
|
|
|
|
$real_date = array_column(array_values($schedule_obj), 'date');
|
|
|
|
$real_date = array_column(array_values($schedule_obj), 'date');
|
|
|
|
foreach ($all_date as $kd => $vd) {
|
|
|
|
foreach ($all_date as $kd => $vd) {
|
|
|
|
if ( ! in_array($vd, $real_date)) {
|
|
|
|
if ( ! in_array($vd, $real_date)) {
|
|
|
|
$this->tldOrderBuilder->setScheduleDetailsTitle($kd, "无")
|
|
|
|
$this->ci->tldOrderBuilder->setScheduleDetailsTitle($kd, "无")
|
|
|
|
->setScheduleDetailsContent($kd, "无")
|
|
|
|
->setScheduleDetailsContent($kd, "无")
|
|
|
|
->setScheduleDetailsAccommodation($kd, "")
|
|
|
|
->setScheduleDetailsAccommodation($kd, "")
|
|
|
|
// ->setScheduleDetailsTraffic($kd, ($vso->PAG_Vehicle>60001 ? 1 : 0))
|
|
|
|
// ->setScheduleDetailsTraffic($kd, ($vso->PAG_Vehicle>60001 ? 1 : 0))
|
|
|
@ -502,7 +504,7 @@ class Tulanduo extends CI_Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach (array_values($schedule_obj) as $kso => $vso) {
|
|
|
|
foreach (array_values($schedule_obj) as $kso => $vso) {
|
|
|
|
if ($vd==$vso['date']) {
|
|
|
|
if ($vd==$vso['date']) {
|
|
|
|
$this->tldOrderBuilder->setScheduleDetailsTitle($kd, $vso['date'])
|
|
|
|
$this->ci->tldOrderBuilder->setScheduleDetailsTitle($kd, $vso['date'])
|
|
|
|
->setScheduleDetailsContent($kd, $vso['content'])
|
|
|
|
->setScheduleDetailsContent($kd, $vso['content'])
|
|
|
|
->setScheduleDetailsAccommodation($kd, $vso['accommodation'])
|
|
|
|
->setScheduleDetailsAccommodation($kd, $vso['accommodation'])
|
|
|
|
// ->setScheduleDetailsTraffic($kd, ($vso->PAG_Vehicle>60001 ? 1 : 0))
|
|
|
|
// ->setScheduleDetailsTraffic($kd, ($vso->PAG_Vehicle>60001 ? 1 : 0))
|
|
|
@ -515,24 +517,23 @@ class Tulanduo extends CI_Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 拆分的订单团款录第一个
|
|
|
|
// 拆分的订单团款录第一个
|
|
|
|
if ($i===1) {
|
|
|
|
if ($i===1) {
|
|
|
|
$this->tldOrderBuilder->setTravelFeesType(0, "Per Group")
|
|
|
|
$this->ci->tldOrderBuilder->setTravelFeesType(0, "Per Group")
|
|
|
|
->setTravelFeesMoney(0, $travel_fees->GAI_SSJE)
|
|
|
|
->setTravelFeesMoney(0, $travel_fees->SUM_SSJE)
|
|
|
|
->setTravelFeesNum(0, 1)
|
|
|
|
->setTravelFeesNum(0, 1)
|
|
|
|
->setTravelFeesUnit(0, 1)
|
|
|
|
->setTravelFeesUnit(0, 1)
|
|
|
|
->setTravelFeesSumMoney(0, $travel_fees->GAI_SSJE);
|
|
|
|
->setTravelFeesSumMoney(0, $travel_fees->SUM_SSJE);
|
|
|
|
// ->setTravelFeesRemark(0, $travel_fees->GAI_Memo);
|
|
|
|
$this->ci->tldOrderBuilder->setReplaceCollectionsType(0, "Per Group")
|
|
|
|
$this->tldOrderBuilder->setReplaceCollectionsType(0, "Per Group")
|
|
|
|
->setReplaceCollectionsMoney(0, $replace_collections->SUM_SSJE)
|
|
|
|
->setReplaceCollectionsMoney(0, $replace_collections->GAI_SSJE)
|
|
|
|
->setReplaceCollectionsRemark(0, $replace_collections->ALL_Memo);
|
|
|
|
->setReplaceCollectionsRemark(0, $replace_collections->GAI_Memo);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 查询是否变更 TODO deprecated
|
|
|
|
// 查询是否变更 TODO deprecated
|
|
|
|
$sync_orderstate = 10;
|
|
|
|
$sync_orderstate = 10;
|
|
|
|
$vps_sn = 0;
|
|
|
|
$vps_sn = 0;
|
|
|
|
$vendor_orderid = 0;
|
|
|
|
$vendor_orderid = 0;
|
|
|
|
$this->tldOrderBuilder->clearModifyLogInfo();
|
|
|
|
$this->ci->tldOrderBuilder->clearModifyLogInfo();
|
|
|
|
$resp = $this->excute_curl($this->neworder_url, $this->tldOrderBuilder);
|
|
|
|
// $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder);
|
|
|
|
// $resp = '{"status":1,"errMsg":"","responseData":{"orderId":' . rand(1000,9999) . '}}'; // test
|
|
|
|
$resp = '{"status":1,"errMsg":"","responseData":{"orderId":' . rand(1000,9999) . '}}'; // test
|
|
|
|
echo $this->tldOrderBuilder->getBizContent();
|
|
|
|
echo $this->ci->tldOrderBuilder->getBizContent();
|
|
|
|
log_message('error',$resp);
|
|
|
|
log_message('error',$resp);
|
|
|
|
$response = json_decode($resp);
|
|
|
|
$response = json_decode($resp);
|
|
|
|
if ($response->status == 1) {
|
|
|
|
if ($response->status == 1) {
|
|
|
@ -551,14 +552,14 @@ log_message('error',$resp);
|
|
|
|
,"VPS_sendTime" => date('Y-m-d H:i:s')
|
|
|
|
,"VPS_sendTime" => date('Y-m-d H:i:s')
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if ($vps_sn === 0) {
|
|
|
|
if ($vps_sn === 0) {
|
|
|
|
$sync_id = $this->Group_model->insert_VendorPlanSync($sync_ret);
|
|
|
|
$sync_id = $this->ci->Group_model->insert_VendorPlanSync($sync_ret);
|
|
|
|
$this->BIZ_orders_model->insert_biz_order_log($coli_sn, "vendorPlanSendout_" . $tour_code);
|
|
|
|
$this->ci->BIZ_order->insert_biz_order_log($coli_sn, "vendorPlanSendout_" . $tour_code);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$update = $this->Group_model->update_VendorPlanSync($vps_sn, $sync_ret);
|
|
|
|
$update = $this->ci->Group_model->update_VendorPlanSync($vps_sn, $sync_ret);
|
|
|
|
$this->BIZ_orders_model->insert_biz_order_log($coli_sn, "vendorPlanUpdateSendout_" . $tour_code);
|
|
|
|
$this->ci->BIZ_order->insert_biz_order_log($coli_sn, "vendorPlanUpdateSendout_" . $tour_code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** VendorArrangeState VAS_IsReceive */
|
|
|
|
/** VendorArrangeState VAS_IsReceive */
|
|
|
|
$this->Group_model->set_plan_received($vas_sn);
|
|
|
|
$this->ci->Group_model->set_plan_received($vas_sn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "[Tulanduo>push_trippest] Done. " . $COLI_ID;
|
|
|
|
return "[Tulanduo>push_trippest] Done. " . $COLI_ID;
|