diff --git a/application/controllers/information.php b/application/controllers/information.php
index 641c4538..3d7c8d50 100644
--- a/application/controllers/information.php
+++ b/application/controllers/information.php
@@ -777,7 +777,7 @@ class Information extends CI_Controller
/* 详细内容 */
$ic_content = $information->ic_content;
// /**替换详细内容里面的价格
- /* 直接使用fetch来啊动态获取价格,这样不用替换标签,直接录标签
+ /* 直接使用fetch来动态获取价格,这样不用替换标签,直接录标签
// * // 一日游价格标签, "" 或者 逗号后面是人数
// * //精华线路标签""
// */
@@ -792,7 +792,7 @@ class Information extends CI_Controller
// return '';;
// },$ic_content);
- $ic_content = '
'.$ic_content.'
'; //兼容拷贝过来的内容样式
+ //$ic_content = ''.$ic_content.'
'; //兼容拷贝过来的内容样式
$data["CUSTOMCONENT"]=$ic_content;
@@ -889,6 +889,11 @@ class Information extends CI_Controller
$addonJs .= '';
}
+ //列表js
+ if ($meta_ct_page_type=="daytripindex" || $meta_ct_page_type=="tourindex"){
+ $addonJs .= '';
+ }
+
$data["ADDONJS"]=$addonJs;
//社媒分享图片
$data["OGIMAGE"]="";
@@ -903,7 +908,18 @@ class Information extends CI_Controller
if (!empty($meta_construction_code)){
$data["ConstructionCode"]=$meta_construction_code;
}
-
+
+ //页面传递参数
+ $passParam = "";
+ if ($meta_ct_page_type=="daytripindex" || $meta_ct_page_type=="tourindex"){
+ //产品首页
+ $meta_ct_page_value = get_meta($information->ic_id,'meta_ct_page_value');
+ $passParam .= '';
+
+ //加信息平台的is_id
+ $passParam .= '';
+ }
+ $data["passParam"] = $passParam;
diff --git a/application/third_party/ctmobilefirst/controllers/api.php b/application/third_party/ctmobilefirst/controllers/api.php
index ef1dec48..ae3cf24b 100644
--- a/application/third_party/ctmobilefirst/controllers/api.php
+++ b/application/third_party/ctmobilefirst/controllers/api.php
@@ -84,6 +84,82 @@ class Api extends CI_Controller {
}
}
+
+ /**
+ * @description: 获取HT及信息平台的一日游列表数据
+ * @param {*}
+ * @return {*}
+ * @Date Changed:
+ */
+ public function getDaytripList(){
+ //先处理传递过来的参数(逗号隔开两个参数的格式:城市名称,父ID)
+ $whereHT="";
+ $whereInfo="";
+ if (isset($_GET["param"])){
+ $param = str_replace("'","''",$_GET["param"]);
+ if (strpos($param,",")!== false){
+ $city = explode(",",$param)[0];
+ $whereHT = " and (CII2_Name ='".$city."') ";
+ $parentid = explode(",",$param)[1];
+ $whereInfo = " and is_parent_id = '".$parentid."'";
+ }else{
+ $whereHT = " and (CII2_Name ='".$param."') ";
+ $whereInfo = "";
+ }
+ }
+
+
+ $list = $this->api_model->getDaytripList($whereHT,$whereInfo);
+
+ foreach ($list as $row) {
+ //获取价格
+ $price = $this->api_model->getDaytripsPrice($row->code,2);
+ if ($price!=null){
+ $PKP_AdultSpecialPrice = $price->PKP_AdultSpecialPrice;
+ $PKP_AdultPrice = $price->PKP_AdultPrice;
+ if ($PKP_AdultPrice!=$PKP_AdultSpecialPrice && $PKP_AdultSpecialPrice>0){
+ $addPrice = $this->currency->convert_moneny_by_char($PKP_AdultSpecialPrice,"USD");
+ }else{
+ $addPrice= $this->currency->convert_moneny_by_char($PKP_AdultPrice,"USD");
+ }
+ }else{
+ $addPrice=0;
+ }
+
+ //URL
+ if (empty($row->url)){
+ $str_Url = "/china-day-trips/".strtolower($row->code).".htm";
+ $row->url = $str_Url; //更新url
+ }
+
+
+ //图片
+ $imageCdn = "//images.chinatravel.com";//有些HT绑定图片需要加cdn
+ if (!empty($row->pic1)){
+ if (strpos($row->pic1,"chinatravel.com")!== false){
+ $picurl=$row->pic1;
+ }else{
+ $picurl = $imageCdn.$row->pic1;
+ }
+
+ }else if(!empty($row->pic2)){
+ if (strpos($row->pic2,"chinatravel.com")!== false){
+ $picurl=$row->pic2;
+ }else{
+ $picurl = $imageCdn.$row->pic2;
+ }
+ }else{
+ $picurl="//data.chinatravel.com/images/loading2.gif";
+ }
+
+ $row->price = $addPrice; //新增价格属性
+ $row->pic =$picurl; //图片地址
+
+ }
+
+ echo json_encode($list);
+ }
+
}
/* End of file Api.php */
diff --git a/application/third_party/ctmobilefirst/models/api_model.php b/application/third_party/ctmobilefirst/models/api_model.php
index d6fce623..11d5b39a 100644
--- a/application/third_party/ctmobilefirst/models/api_model.php
+++ b/application/third_party/ctmobilefirst/models/api_model.php
@@ -148,6 +148,129 @@ class Api_model extends CI_Model {
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 */