|
|
|
@ -16,6 +16,34 @@ class Paypal_model extends CI_Model {
|
|
|
|
|
$this->userdata = $this->session->userdata('userdata');
|
|
|
|
|
$this->userID = isset($this->userdata['OPI_SN']) ? $this->userdata['OPI_SN'] : 'null';
|
|
|
|
|
}
|
|
|
|
|
public function call_sp_fun($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);
|
|
|
|
|
$result_object = array();
|
|
|
|
|
if (false !== $stmt ) { // 无权限或执行错误返回false
|
|
|
|
|
// 存储过程中每个select都产生结果集
|
|
|
|
|
// 设置了SET NOCOUNT ON;就只有输出的结果集
|
|
|
|
|
$a = true;
|
|
|
|
|
while ($a !== false) {
|
|
|
|
|
$row = sqlsrv_fetch_object($stmt); // Retrieves the next row of data as a PHP object.
|
|
|
|
|
$a = !empty($row);
|
|
|
|
|
$a===true ? $result_object[] = $row : null;
|
|
|
|
|
}
|
|
|
|
|
sqlsrv_free_stmt($stmt);
|
|
|
|
|
}
|
|
|
|
|
sqlsrv_close($conn);
|
|
|
|
|
return $result_object;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据订单号获取外联邮箱
|
|
|
|
|
public function get_order($COLI_ID, $orderinfo = false, $ordertype = 'N', $handpick=false) {
|
|
|
|
@ -686,7 +714,8 @@ class Paypal_model extends CI_Model {
|
|
|
|
|
// log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' exec_BIZ_TrainCostAdd' . PHP_EOL . var_export(1, 1));
|
|
|
|
|
$sql = " exec SP_BIZ_TrainCostAdd $COLI_SN,$ssje ; select 0;";
|
|
|
|
|
log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($sql, 1));
|
|
|
|
|
$this->HT->query($sql);
|
|
|
|
|
// $this->HT->query($sql);
|
|
|
|
|
$this->call_sp_fun($sql);
|
|
|
|
|
return false;
|
|
|
|
|
// return $query;
|
|
|
|
|
}
|
|
|
|
|