diff --git a/application/controllers/information.php b/application/controllers/information.php index 9e492a32..a4557e50 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -813,7 +813,14 @@ class Information extends CI_Controller $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); if($device=='mobile'){//移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); - $bannerImg = '' . $information->ic_title . ''; + $bannerImg = '' . $information->ic_title . ''; + $meta_addon_picture_text = get_meta($information->ic_id,'meta_addon_picture_text'); + if(!empty($meta_addon_picture_url)){ + $ImgText = ''; + }else{ + $ImgText = ''; + } + }else{ $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $bannerImg = '' . $information->ic_title . ''; @@ -892,7 +899,7 @@ class Information extends CI_Controller } //列表js - if ($meta_ct_page_type=="daytripindex" || $meta_ct_page_type=="tourindex"){ + if (in_array($meta_ct_page_type,array('daytripindex','tourindex','attractionindex'))){ $addonJs .= ''; } @@ -913,14 +920,23 @@ class Information extends CI_Controller //页面传递参数 $passParam = ""; - if ($meta_ct_page_type=="daytripindex" || $meta_ct_page_type=="tourindex"){ + if (in_array($meta_ct_page_type,array("daytripindex","tourindex","attractionindex")) ){ //一日游和线路列表 //产品首页 $meta_ct_page_value = get_meta($information->ic_id,'meta_ct_page_value'); - $passParam .= ''; + + if (in_array($meta_ct_page_type,array("attractionindex") )){ + //旧信息id,景点等信息类 + $passParam .= ''; + }else{ + //城市名称,产品类用 + $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 ae3cf24b..c40e80e0 100644 --- a/application/third_party/ctmobilefirst/controllers/api.php +++ b/application/third_party/ctmobilefirst/controllers/api.php @@ -104,7 +104,7 @@ class Api extends CI_Controller { $whereInfo = " and is_parent_id = '".$parentid."'"; }else{ $whereHT = " and (CII2_Name ='".$param."') "; - $whereInfo = ""; + $whereInfo = " and is_parent_id = -1 "; } } @@ -160,6 +160,54 @@ class Api extends CI_Controller { echo json_encode($list); } + + /** + * @description: 获取新旧网站的子类列表 + * @param {*} $old_pid + * @param {*} $new_pid + * @return {*} + * @Date Changed: + */ + public function getGuideList($old_pid = null,$new_pid=null) + { + //处理参数 + if (isset($_GET["param"])){ + $param = str_replace("'","''",$_GET["param"]); + if (strpos($param,",")!== false){ + $new_pid = explode(",",$param)[0]; + $old_pid = explode(",",$param)[1]; + }else{ + $old_pid = -1; + $new_pid = $param; + } + + } + + if (empty($old_pid) || !is_numeric($old_pid)){ + $old_pid = -1 ; + } + + if (empty($new_pid)|| !is_numeric($new_pid)){ + $new_pid = -1; + } + + $list = $this->api_model->getGuideList($old_pid,$new_pid); + foreach ($list as $row) { + //图片 + if (!empty($row->ic_photo)){ + $picurl = $row->ic_photo; + }else if (!empty($row->pic1)){ + $picurl = $row->pic1; + }else{ + $picurl="//data.chinatravel.com/images/loading2.gif"; + } + + $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 11d5b39a..b2c7c986 100644 --- a/application/third_party/ctmobilefirst/models/api_model.php +++ b/application/third_party/ctmobilefirst/models/api_model.php @@ -246,28 +246,38 @@ class Api_model extends CI_Model { /** * @description: 获取子类信息列表 - * @param {type} $parentid,父类的Id + * @param {type} $old_pid,$new_pid 父类的Id,分为旧网站的和新网站的 * @return: * @Date Changed: */ - function getGuideList($parentid){ - if ($parentid < 0 ) { - return null; - } - - + function getGuideList($old_pid,$new_pid){ $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 + select * from ( + SELECT ic_url,ic_url_title,ic_photo + ,(select top 1 im_value from infoMetas where im_key='meta_addon_picture_mobile' and im_ic_id=ic_id) as pic2 + ,'2' as sortby + FROM dbo.infoContents + inner join infoStructures on ic_id=is_ic_id + WHERE is_sitecode='ct' + and ic_status=1 + and is_parent_id = ? + + UNION ALL + + SELECT ic_url,ic_url_title,ic_photo + ,(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' - and is_parent_id = ? + and ic_status=1 + and is_parent_id = ? + ) allbt + order by sortby "; - //and ic_status=1 - $qurey = $this->HT->query($sql,array($parentid)); + $qurey = $this->HT->query($sql,array($old_pid,$new_pid)); return $qurey->result(); } diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 1aae2bfe..d835cc58 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -689,7 +689,7 @@ - ic_sitecode == 'ct') { ?> + ic_sitecode == 'ct' || $information->ic_sitecode == 'chinatravel' ) { ?>
@@ -904,7 +907,7 @@ -