You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
information-system/webht/third_party/trippestOrderSync/models/order_update.php

137 lines
5.0 KiB
PHTML

<?php
class Order_update 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;
}
public $coli_where_update = "";
public function biz_confirmlineinfo_update($column_data)
{
if ($this->coli_where_update == "" || empty($column_data)) {
return false;
}
$update_str = $this->HT->update_string('BIZ_ConfirmLineInfo', $column_data, $this->coli_where_update);
$update_exc = $this->HT->query($update_str);
return $update_exc;
}
public $cold_where_update = "";
public function biz_confirmlinedetail_update($column_data)
{
if ($this->cold_where_update == "" || empty($column_data)) {
return false;
}
$update_str = $this->HT->update_string('BIZ_ConfirmLineDetail', $column_data, $this->cold_where_update);
$update_exc = $this->HT->query($update_str);
return $update_exc;
}
public $gci_where_update = "";
public function biz_groupcombineinfo_update($column_data)
{
if ($this->gci_where_update == "" || empty($column_data)) {
return false;
}
$update_str = $this->HT->update_string('BIZ_GroupCombineInfo', $column_data, $this->gci_where_update);
$update_exc = $this->HT->query($update_str);
return $update_exc;
}
public function combineoperation_exist($combineNo='', $operation="")
{
if( ! $combineNo) { return false; }
$sql = "SELECT TOP 1 GCOD_GCI_combineNo
FROM BIZ_GroupCombineOperationDetail
WHERE GCOD_GCI_combineNo = N? and GCOD_operationType=?";
$query = $this->HT->query($sql, array(
$combineNo,$operation
));
return $query->result();
}
public function update_confirmLineInfo()
{
$sql = "UPDATE BIZ_ConfirmLineInfo SET
COLI_GRI_SN=?,
COLI_GroupCode=?
WHERE COLI_SN=?
";
$query = $this->HT->query($sql, array(
$this->BIZ_COLI_GRI_SN
,$this->BIZ_COLI_GroupCode
,$this->BIZ_COLI_SN
));
return $this->query;
}
/**
*
* 更新订单状态(商务订单)
*
*/
public function update_biz_order($order_id, $pay_manager, $source_type, $state, $text = '') {
//更新订单
$sql = "UPDATE BIZ_ConfirmLineInfo SET COLI_PayManner=?,COLI_sourcetype=?,COLI_State=?,COLI_OrderDetailText=COLI_OrderDetailText+? WHERE COLI_ID=?";
$query = $this->HT->query($sql, array($pay_manager, $source_type, $state, $text, $order_id . ''));
$this->insert_acc_info($order_id);
return '是否执行:' . print_r($query, true) . ' sql:' . $sql . ' 参数:' . print_r(array($pay_manager, $source_type, $state, $text, $order_id . ''), true);
}
/**
*
* 更新火车订单购票截图
*
*/
public function update_train_order_pic($order_pic_id) {
//更新订单
$sql = "exec dbo.SP_BIZ_GroupFinanceList_Insert '" . $order_pic_id . "'";
//$query = $this->HT->query($sql);
include('c:/database_conn.php');
$connection = array(
'UID' => $db['HT']['username'],
'PWD' => $db['HT']['password'],
'Database' => 'tourmanager',
'ConnectionPooling' => 1,
'CharacterSet' => 'utf-8',
'ReturnDatesAsStrings' => 1
);
$conn = sqlsrv_connect($db['HT']['hostname'], $connection);
$stmt = sqlsrv_query($conn, $sql);
return $stmt;
}
function SendMail($fromName, $fromEmail, $toName, $toEmail, $subject, $body) {
$sql = "INSERT INTO Email_AutomaticSend \n"
. " ( \n"
. " M_ReplyToName, M_ReplyToEmail, M_ToName, M_ToEmail, M_Title, M_Body, M_Web, \n"
. " M_FromName, M_State \n"
. " ) \n"
. "VALUES \n"
. " ( \n"
. " ?, ?, ?, ?, ?, N?, ?, ?, 0 \n"
. " ) ";
$query = $this->HT->query($sql,
array(substr($fromName, 0, 127), $fromEmail, substr($toName, 0, 127), $toEmail, $subject, $body, $this->config->item('Site_Code'), $this->config->item('Site_SenderName'))
);
return $query;
}
}