trippest 客人查询: 获取海纳传统团的组团人

feature/pay
lyt 7 years ago
parent a239cc12e9
commit 9edf348ef1

@ -51,6 +51,8 @@ class TulanduoApi extends CI_Controller
public function __construct(){
parent::__construct();
mb_regex_encoding("UTF-8");
bcscale(4);
$this->load->helper('array');
$this->load->model('Orders_model');
$this->load->model('TuLanDuo_queryContentBuilder', 'tld_order');
@ -67,8 +69,6 @@ class TulanduoApi extends CI_Controller
// 桂林海纳国旅
// $this->userId = "18";
// $this->key = "d05c25e6e6c5d4898161e0aaf700d9c7";
mb_regex_encoding("UTF-8");
bcscale(4);
}
/*!

@ -5,9 +5,9 @@ class Api extends CI_Controller {
public function __construct(){
parent::__construct();
mb_regex_encoding("UTF-8");
$this->load->helper('array');
$this->load->model('Orders_model');
mb_regex_encoding("UTF-8");
}
public function index()
@ -38,6 +38,7 @@ class Api extends CI_Controller {
{
return $ele->GCI_combineNo;
}, $order_project));
$ret['operation'] = null;
$operation = $this->Orders_model->get_operation($all_combine_no);
// 司机, 导游
if ( ! empty($operation)) {
@ -122,7 +123,15 @@ class Api extends CI_Controller {
unset($vro);
}
$ret['operation'] = array_values($ret['operation']);
$operator = $this->Orders_model->get_operator($order_project[0]->COLI_OPI_ID);
/** 外联信息 */
$raw_opi_id = 0;
if (intval($order_project[0]->COLI_OPI_ID) === 435) {
$real_code = analysis_groupCode($ret['group_number']);
$raw_opi_id = $this->Orders_model->get_gri_opi_id($real_code);
} else {
$raw_opi_id = $order_project[0]->COLI_OPI_ID;
}
$operator = $this->Orders_model->get_operator($raw_opi_id);
if ( ! empty($operator)) {
$ret['operator']['chinese_name'] = $operator->OPI_Name;
$ret['operator']['mobile'] = $operator->OPI_MoveTelephone;

@ -5,7 +5,7 @@
参数| 类型 | 示例 | -
--- | --- | --- | ---
q | string | 180601019 | 渠道订单, 不返回外联信息
q | string | 180807025 | 渠道订单, 不返回外联信息
| | 180524043M | 单接送+Day Tour,共4天
#### RETURN JSON

@ -108,3 +108,36 @@ function raw_json_encode($input, $flags = 0) {
};
return preg_replace_callback($pattern, $callback, json_encode($input, $flags));
}
/*!
* 目的地项目组的订单计划的团号分析
* 去除添加的后缀, 只保留前两部分: XXXXXX-YYYYYYYYYYYY
* @date 2018-05-02
* @param [type] $groupCode 从地接系统获取到的团号
*/
function analysis_groupCode($groupCode)
{
mb_regex_encoding("UTF-8");
preg_match('/[\w\s\-]+/', characet($groupCode, "UTF-8"), $temp_array);
$temp_array[0] = strrchr($temp_array[0], " ") ? mb_strstr($temp_array[0], " ",true) : $temp_array[0];
$tmp_groupCode = explode("-", trim($temp_array[0]));
$real_groupCode = $tmp_groupCode[0] . "-";
$real_groupCode .= mb_strstr($tmp_groupCode[1], "", true)!==false ? mb_strstr($tmp_groupCode[1], "", true) : $tmp_groupCode[1];
$real_groupCode = mb_ereg_replace('( )', '', trim($real_groupCode));
return $real_groupCode;
}
/*!
* 转换字符集编码
* @param $data
* @param $targetCharset
* @return string
*/
function characet($data, $targetCharset) {
if (!empty($data)) {
$fileType = "UTF-8";
if (strcasecmp($fileType, $targetCharset) != 0) {
$data = mb_convert_encoding($data, $targetCharset, $fileType);
// $data = iconv($fileType, $targetCharset.'//IGNORE', $data);
}
}
return $data;
}

@ -518,10 +518,10 @@ class Orders_model extends CI_Model {
if ($gri_query->num_rows() > 0) {
$this->GRI_SN = $gri_query->row()->GRI_SN;
$this->GRI_operator = $gri_query->row()->GRI_operator;
$coli_sql = "SELECT top 1 COLI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,coli.COLI_Memo,
coli.COLI_OrderDetailText,coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency
$coli_sql = "SELECT top 1 COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,coli.COLI_Memo, coli.COLI_OrderDetailText,coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency
FROM BIZ_ConfirmLineInfo coli
inner join BIZ_ConfirmLineDetail cold on cold.COLD_COLI_SN=COLI_SN
LEFT JOIN GRoupInfo gri ON coli.COLI_GRI_SN=gri.GRI_SN
where COLI_GRI_SN=" . $this->GRI_SN;
$coli_query = $this->HT->query($coli_sql);
if ($coli_query->num_rows() > 0) {
@ -533,6 +533,19 @@ class Orders_model extends CI_Model {
return NULL;
}
/** 获取海纳团的发团人 */
public function get_gri_opi_id($code)
{
$gri_sql = "SELECT top 1 GRI_SN,GRI_OPI_ID,isnull(GRI_operator,0) GRI_operator,GRI_No,GRI_Name
from GRoupInfo
where GRI_Name like '%$code%' ";
$gri_query = $this->HT->query($gri_sql);
if ($gri_query->num_rows() > 0) {
return $gri_query->row()->GRI_operator;
}
return 0;
}
/*!
* 获取地接社接受计划的人员信息
* @param $vendorID 地接社ID
@ -1304,7 +1317,7 @@ class Orders_model extends CI_Model {
return $ret;
}
function get_operator($OPI_SN)
function get_operator($OPI_SN=0)
{
$operator_sql = "SELECT opi.OPI_SN,opi.OPI_Name,opi.OPI_FirstName,OPI_MoveTelephone,OPI_Email,opi2.OPI2_Name
from OperatorInfo opi

Loading…
Cancel
Save