查询bug

feature/pay
lyt 8 years ago
parent acb8fcafa9
commit 7921462d17

@ -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()) {

@ -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)) {

@ -0,0 +1,122 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Tulanduo_sync_model extends CI_Model {
function __construct() {
parent::__construct();
$this->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 */
Loading…
Cancel
Save