|
|
@ -148,6 +148,129 @@ class Api_model extends CI_Model {
|
|
|
|
return $reust;
|
|
|
|
return $reust;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @description: 一日游列表,包含信息平台和HT
|
|
|
|
|
|
|
|
* @param {*} $whereHT HT的查询条件
|
|
|
|
|
|
|
|
* @param {*} $whereInfo 信息平台的查询条件
|
|
|
|
|
|
|
|
* @return {*}
|
|
|
|
|
|
|
|
* @Date Changed:
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function getDaytripList($whereHT="",$whereInfo=""){
|
|
|
|
|
|
|
|
$sql = "select * from(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select * from(
|
|
|
|
|
|
|
|
SELECT p2.PAG2_Name as title
|
|
|
|
|
|
|
|
,P1.PAG_Code as code
|
|
|
|
|
|
|
|
,'' as url
|
|
|
|
|
|
|
|
,isnull(p2.PAG2_ImageURL,'') as pic1
|
|
|
|
|
|
|
|
,isnull((select top 1 PAP_ImageURL from BIZ_PackagePic where PAP_PII_SN=p2.PAG2_PII_SN),'') as pic2
|
|
|
|
|
|
|
|
,'2' as sortby
|
|
|
|
|
|
|
|
FROM dbo.BIZ_PackageInfo P1
|
|
|
|
|
|
|
|
INNER JOIN dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN
|
|
|
|
|
|
|
|
INNER JOIN dbo.CItyInfo2 ON P1.PAG_CII_SN = dbo.CItyInfo2.CII2_CII_SN AND dbo.CItyInfo2.CII2_LGC = 1
|
|
|
|
|
|
|
|
WHERE (p2.PAG2_LGC = 104)
|
|
|
|
|
|
|
|
AND (p1.pag_dei_sn = 17)
|
|
|
|
|
|
|
|
AND (p2.PAG2_Check = 2)
|
|
|
|
|
|
|
|
AND (isnull(P1.DeleteFlag,0) <>1) ".$whereHT."
|
|
|
|
|
|
|
|
) Tmp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * from (
|
|
|
|
|
|
|
|
select ic_url_title as title
|
|
|
|
|
|
|
|
,(select top 1 im_value from infoMetas where im_key='meta_product_code' and im_ic_id=ic_id) as code
|
|
|
|
|
|
|
|
,ic_url as url , ic_photo as pic1
|
|
|
|
|
|
|
|
,(select top 1 im_value from infoMetas where im_key='meta_addon_picture_mobile' and im_ic_id=ic_id) as pic2
|
|
|
|
|
|
|
|
,'1' as sortby
|
|
|
|
|
|
|
|
FROM dbo.infoContents
|
|
|
|
|
|
|
|
inner join infoStructures on ic_id=is_ic_id
|
|
|
|
|
|
|
|
WHERE is_sitecode='chinatravel' ".$whereInfo."
|
|
|
|
|
|
|
|
--and ic_status=1
|
|
|
|
|
|
|
|
) as t
|
|
|
|
|
|
|
|
) tball
|
|
|
|
|
|
|
|
where 1=1
|
|
|
|
|
|
|
|
ORDER BY tball.sortBy ASC
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->HT->query($sql);
|
|
|
|
|
|
|
|
return $query->result();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @description: HT获取一日游列表
|
|
|
|
|
|
|
|
* @param {*} $city 一日游城市 ,默认必须有城市,不然太多
|
|
|
|
|
|
|
|
* @param {*} $where 其它条件
|
|
|
|
|
|
|
|
* @return {*}
|
|
|
|
|
|
|
|
* @Date Changed:
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function getDaytripListHT($city="beijing",$where=""){
|
|
|
|
|
|
|
|
$sql = " select * from(
|
|
|
|
|
|
|
|
SELECT p2.PAG2_Name
|
|
|
|
|
|
|
|
,p2.PAG2_Intro
|
|
|
|
|
|
|
|
,P1.PAG_NeedTime
|
|
|
|
|
|
|
|
,P1.PAG_SN
|
|
|
|
|
|
|
|
,P1.PAG_Leve
|
|
|
|
|
|
|
|
,p2.PAG2_Order
|
|
|
|
|
|
|
|
,P1.PAG_Code
|
|
|
|
|
|
|
|
,p2.PAG2_Attraction
|
|
|
|
|
|
|
|
,CItyInfo2.CII2_Name
|
|
|
|
|
|
|
|
,isnull((select top 1 PAP_ImageURL from BIZ_PackagePic where PAP_PII_SN=p2.PAG2_PII_SN),'') as NewListImage
|
|
|
|
|
|
|
|
,isnull(p2.PAG2_ImageURL,'') as NewListImage2
|
|
|
|
|
|
|
|
,dbo.GetFullPathByPII_SN(p2.PAG2_PII_SN, 2) AS picpath
|
|
|
|
|
|
|
|
,p2.PAG2_Title
|
|
|
|
|
|
|
|
,p1.PAG_Type
|
|
|
|
|
|
|
|
,pag2_summary
|
|
|
|
|
|
|
|
FROM dbo.BIZ_PackageInfo P1
|
|
|
|
|
|
|
|
INNER JOIN dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN
|
|
|
|
|
|
|
|
INNER JOIN dbo.CItyInfo2 ON P1.PAG_CII_SN = dbo.CItyInfo2.CII2_CII_SN AND dbo.CItyInfo2.CII2_LGC = 1
|
|
|
|
|
|
|
|
WHERE (p2.PAG2_LGC = ?)
|
|
|
|
|
|
|
|
AND (p1.pag_dei_sn = ?)
|
|
|
|
|
|
|
|
AND (p2.PAG2_Check = 2)
|
|
|
|
|
|
|
|
AND (isnull(P1.DeleteFlag,0) <>1)
|
|
|
|
|
|
|
|
) Tmp
|
|
|
|
|
|
|
|
where 1=1 ";
|
|
|
|
|
|
|
|
if ($city!=""){
|
|
|
|
|
|
|
|
$sql .= " AND (CII2_Name ='".$city."')";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// $sql .= "and PAG_Code in ('SHALC-1','SHALC-7')";
|
|
|
|
|
|
|
|
$sql .= " order by isnull(pag2_order,0) desc,pag_code ";
|
|
|
|
|
|
|
|
// echo ($sql);
|
|
|
|
|
|
|
|
$param = array($this->CTLGC,$this->dei_sn);
|
|
|
|
|
|
|
|
$query = $this->HT->query($sql,$param);
|
|
|
|
|
|
|
|
return $query->result();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @description: 获取子类信息列表
|
|
|
|
|
|
|
|
* @param {type} $parentid,父类的Id
|
|
|
|
|
|
|
|
* @return:
|
|
|
|
|
|
|
|
* @Date Changed:
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function getGuideList($parentid){
|
|
|
|
|
|
|
|
if ($parentid < 0 ) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "
|
|
|
|
|
|
|
|
SELECT is_sort,ic_url,ic_url_title,ic_title, substring(convert(nvarchar(2000),ic_content),0,1000) as ic_summary,ic_photo
|
|
|
|
|
|
|
|
,(select top 1 im_value from infoMetas where im_key='meta_addon_picture' and im_ic_id=ic_id) as pic2
|
|
|
|
|
|
|
|
FROM dbo.infoContents
|
|
|
|
|
|
|
|
inner join infoStructures on ic_id=is_ic_id
|
|
|
|
|
|
|
|
WHERE is_sitecode='chinatravel'
|
|
|
|
|
|
|
|
and is_parent_id = ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
//and ic_status=1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$qurey = $this->HT->query($sql,array($parentid));
|
|
|
|
|
|
|
|
return $qurey->result();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* End of file Api_model.php */
|
|
|
|
/* End of file Api_model.php */
|
|
|
|