From 7921462d1771e7a7495d850dab22b6076dc7172f Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 24 Aug 2018 15:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/TulanduoApi.php | 8 ++ .../trippestOrderSync/controllers/api.php | 2 +- .../models/tulanduo_sync_model.php | 122 ++++++++++++++++++ 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 webht/third_party/trippestOrderSync/models/tulanduo_sync_model.php diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php index b2370792..788f903c 100644 --- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php +++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php @@ -399,6 +399,14 @@ class TulanduoApi extends CI_Controller ); $this->Order_update->biz_confirmlineinfo_update($coli_update_column); /** BIZ_ConfirmLineDetail */ + if (isset($getInfo_byGroupCode->COLI_SN) && intval($getInfo_byGroupCode->COLI_OPI_ID)===435) { + $cold_update_column = array( + "COLD_PersonNum" => $detail_jsonResp->orderDetail->adultNum + ,"COLD_ChildNum" => $detail_jsonResp->orderDetail->childNum + ); + $this->Order_update->cold_where_update = " COLD_SN=" . $getInfo_byGroupCode->COLD_SN; + $this->Order_update->biz_confirmlinedetail_update($cold_update_column); + } /** INSERT */ /*BIZ_BookPeople*/ if ($this->Orders_model->bookpeople_exist($cold_sn) === array()) { diff --git a/webht/third_party/trippestOrderSync/controllers/api.php b/webht/third_party/trippestOrderSync/controllers/api.php index fa89eb5d..1562f36b 100644 --- a/webht/third_party/trippestOrderSync/controllers/api.php +++ b/webht/third_party/trippestOrderSync/controllers/api.php @@ -39,7 +39,7 @@ class Api extends CI_Controller { { return $ele->GCI_combineNo; }, $order_project)); - $ret['operation'] = null; + $ret['operation'] = array(); $operation = $this->Orders_model->get_operation($all_combine_no); // 司机, 导游 if ( ! empty($operation)) { diff --git a/webht/third_party/trippestOrderSync/models/tulanduo_sync_model.php b/webht/third_party/trippestOrderSync/models/tulanduo_sync_model.php new file mode 100644 index 00000000..92c51eea --- /dev/null +++ b/webht/third_party/trippestOrderSync/models/tulanduo_sync_model.php @@ -0,0 +1,122 @@ +HT = $this->load->database('HT', TRUE); + //读取默认配置 + $this->COLI_WebCode = $this->config->item('Site_Code'); + $this->COLI_Area = $this->config->item('Site_Area'); + $this->COLI_CustomerType = $this->config->item('Site_DepartmentID'); + $this->COLI_department = $this->config->item('Site_Department'); + $this->COLI_Currency = $this->config->item('Site_Currency'); + $this->COLI_InterestRate = $this->config->item('Site_InterestRate'); + $this->COLI_TrueCardRate = $this->config->item('Site_TrueCardRate'); + $this->COLI_TouristLGC = $this->config->item('Site_ServiceLGC'); + $this->COLI_OrderStartDate = null; + $this->COLI_Keywords = NULL; + switch ($this->check_device()) { + case 'mobile': + $this->COLI_OrderSource = '62003'; + break; + case 'tablet': + $this->COLI_OrderSource = '62002'; + break; + default: + $this->COLI_OrderSource = '62001'; + } + } + + /*! + * 查询图兰朵订单id是否已存在 + * @param string $vendorOrderIds [description] + */ + public function get_exists_vendorOrderId($vendorOrderIds="") + { + $sql = "SELECT GCI_VendorOrderId FROM GroupCombineInfo + WHERE GCI_VendorOrderId IN ($vendorOrderIds) "; + return $this->HT->query($sql)->result(); + } + /*! + * 从图兰朵同步历史数据的日期偏移 + * 获取HT内图兰朵订单的最老出发日期 + */ + public function get_oldest_offset() + { + $sql = "SELECT top 1 CAST(GCI_travelDate as DATE) old_date from GroupCombineInfo + order by GCI_travelDate asc"; + return $this->HT->query($sql)->row()->old_date; + } + /*! + * 图兰朵订单在HT内的信息 + * @param [type] $code [description] + * @param [type] $vendorOrderId [description] + */ + public function get_vendorOrder_HTinfo($code, $vendorOrderId=NULL) + { + # code... + } + + public $GCI_SN; + public $GCI_VEI_SN; + public $GCI_combineNo=''; // 拼团团号 + public $GCI_GRI_SN; // 团key + public $GCI_VendorOrderId; // 地接社系统订单id + public $GCI_FromAgc; // 组团社来源 + public $GCI_groupType; // 组团社来源 + public $GCI_travelDate; + public $GCI_leaveDate; + public $GCI_createTime; + /** 目的地订单 拼团信息 */ + public function biz_groupcombineinfo_save() + { + $sql = "IF NOT EXISTS( + SELECT TOP 1 1 + FROM GroupCombineInfo + WHERE GCI_VendorOrderId = ? and GCI_GRI_SN=? and GCI_VEI_SN=? + ) + INSERT INTO GroupCombineInfo + (GCI_combineNo + ,GCI_GRI_SN + ,GCI_VEI_SN + ,GCI_VendorOrderId + ,GCI_FromAgc + ,GCI_groupType + ,GCI_travelDate + ,GCI_leaveDate + ,GCI_createTime) + VALUES + (N? + ,? + ,? + ,? + ,N? + ,? + ,? + ,? + ,?) + "; + $query = $this->HT->query($sql, array( + $this->GCI_VendorOrderId + ,$this->GCI_GRI_SN + ,$this->GCI_VEI_SN + ,$this->GCI_combineNo + ,$this->GCI_GRI_SN + ,$this->GCI_VEI_SN + ,$this->GCI_VendorOrderId + ,$this->GCI_FromAgc + ,$this->GCI_groupType + ,$this->GCI_travelDate + ,$this->GCI_leaveDate + ,$this->GCI_createTime + )); + $this->GCI_SN = $this->HT->query("select MAX(GCI_SN) as insert_id FROM GroupCombineInfo WHERE GCI_combineNo='" . $this->GCI_combineNo . "'")->row('insert_id'); + return $this->GCI_SN; + } + +} + +/* End of file tulanduo_sync_model.php */ +/* Location: ./webht/third_party/trippestOrderSync/models/tulanduo_sync_model.php */