获取一日游列表类型及扩展类型列表接口

master
赵鹏 10 months ago
parent 2f8606420c
commit b44fb213dc

@ -478,6 +478,14 @@ class Api extends CI_Controller {
echo json_encode($list,JSON_UNESCAPED_UNICODE);
}
/**
* 获取发布的一日游详细页的所有产品对应的类型列表,扩展类型列表。(用于搜索页)
*/
public function getPagTypeList(){
$list = $this->api_model->getLineTypeList();
echo json_encode($list,JSON_NUMERIC_CHECK);
}
}
/* End of file Api.php */

@ -649,7 +649,7 @@ class Api_model extends CI_Model {
/**
* 获取所有录入线路的列表
*/
public function getTourList(){
function getTourList(){
$sql = "SELECT convert(varchar(100),(
SELECT TOP 1 im_value
FROM information_ct.dbo.infoMetas
@ -751,6 +751,93 @@ class Api_model extends CI_Model {
}
/**
* 获取发布的一日游详细页的所有产品对应的类型列表,扩展类型列表。(用于搜索页)
*/
function getPagTypeList(){
$sql = " SELECT DISTINCT PAG_Type ,PAG_ExtendType
FROM dbo.BIZ_PackageInfo P1 INNER JOIN
dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN
WHERE (pag_dei_sn= 25 )
AND (p2.PAG2_Check = 2)
AND (PAG2_LGC = 107)
and PAG_Code in ( SELECT convert(varchar(100),(
SELECT TOP 1 im_value
FROM information_ct.dbo.infoMetas
WHERE im_key = 'meta_ct_page_value'
AND im_ic_id = ic_id
)) AS code
FROM information_ct.dbo.infoContents
INNER JOIN information_ct.dbo.infoStructures ON ic_id = is_ic_id
WHERE is_sitecode ='shanghai' AND ic_status = 1
and ic_id in (select im_ic_id from information_ct.dbo.infoMetas where im_key='meta_ct_page_type' and convert(varchar(100),im_value)='daytripdetail')
) ";
$query =$this->HT->query($sql);
$type_values = array(); //类型
$extendType_values = array(); //扩展类型
if ($query->num_rows() > 0) {
foreach ($query->result_array() as $row) {
$column_data = $row['PAG_Type'];
// 分割逗号分隔的值
$values = explode(',', $column_data);
// 去除每个值的空白字符
$values = array_map('trim', $values);
// 合并到总数组
$type_values = array_merge($type_values, $values);
$column_data2 = $row['PAG_ExtendType'];
// 分割逗号分隔的值
$values2 = explode(',', $column_data);
// 去除每个值的空白字符
$values2 = array_map('trim', $values);
// 合并到总数组
$extendType_values = array_merge($extendType_values, $values2);
}
}
// 去重
$unique_values = array_unique($type_values);
$unique_values2 = array_unique($extendType_values);
// 合并为逗号分隔的字符串,所有类型的字符串
$type_string = implode(',', $unique_values);
$extendType_string = implode(',', $unique_values2);
$resultClass = new stdClass();
$sql2 = " select SYC_SN, SYC2_CodeDiscribe
from SystemCode
inner join SystemCode2 on SYC_SN = SYC2_SYC_SN
where SYC_Type=6 and SYC2_LGC=".$this->CTLGC." and SYC2_CodeDiscribe>'' and SYC_SN in (".$type_string.") ";
$query = $this->HT->query($sql2);
if ($query->num_rows()>0){
$resultClass->type = $query->result();
}else {
$resultClass->type = [];
}
$sql3 = " select SYC_SN, SYC2_CodeDiscribe
from SystemCode
inner join SystemCode2 on SYC_SN = SYC2_SYC_SN
where SYC_Type=6 and SYC2_LGC=".$this->CTLGC." and SYC2_CodeDiscribe>'' and SYC_SN in (".$extendType_string.") ";
$query = $this->HT->query($sql3);
if ($query->num_rows()>0){
$resultClass->extendType = $query->result();
}else {
$resultClass->extendType = [];
}
return $resultClass;
}
}
/* End of file Api_model.php */

Loading…
Cancel
Save