diff --git a/application/third_party/ctmobilefirst/controllers/api.php b/application/third_party/ctmobilefirst/controllers/api.php index 2c8c7ffa..c8f7a566 100644 --- a/application/third_party/ctmobilefirst/controllers/api.php +++ b/application/third_party/ctmobilefirst/controllers/api.php @@ -193,7 +193,7 @@ class Api extends CI_Controller { }else if (!empty($row->pic1)){ $picurl = $row->pic1; }else{ - $picurl="//data.chinatravel.com/images/loading2.gif"; + $picurl="//data.chinatravel.com/images/no-photos.jpg"; } // if (strpos($picurl,"chinatravel.com")!== false){ // }else{ diff --git a/application/third_party/ctmobilefirst/models/api_model.php b/application/third_party/ctmobilefirst/models/api_model.php index db94f2b7..ebb74ee5 100644 --- a/application/third_party/ctmobilefirst/models/api_model.php +++ b/application/third_party/ctmobilefirst/models/api_model.php @@ -263,16 +263,42 @@ 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 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 +313,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(); }