diff --git a/application/third_party/ctmobilefirst/models/api_model.php b/application/third_party/ctmobilefirst/models/api_model.php index db94f2b7..72e71e9a 100644 --- a/application/third_party/ctmobilefirst/models/api_model.php +++ b/application/third_party/ctmobilefirst/models/api_model.php @@ -263,16 +263,43 @@ class Api_model extends CI_Model { * @Date Changed: */ function getGuideList($old_pid,$new_pid){ + + $sql = " select top 1 ic_url from dbo.infoContents + inner join infoStructures on ic_id=is_ic_id + where is_id = ? "; + + $query = $this->HT->query ($sql ,array($new_pid)); + + if ($query->num_rows()>0){ + $url = $query->row()->ic_url; + }else{ + $url = ""; + } + + if ($url==""){$url="nourl";} + + ////原来读取旧信息数据 + // 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 = ? + + $sql = " - 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 + 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' + WHERE is_sitecode='chinatravel' and ic_status=1 - and is_parent_id = ? + and ic_url like ? UNION ALL @@ -287,9 +314,8 @@ class Api_model extends CI_Model { ) allbt order by sortby - "; - - $qurey = $this->HT->query($sql,array("-1",$new_pid)); + "; + $qurey = $this->HT->query($sql,array($url."/%",$new_pid)); return $qurey->result(); }