diff --git a/application/controllers/information.php b/application/controllers/information.php index 6af1d83f..0d79f1c3 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -850,6 +850,8 @@ class Information extends CI_Controller $this->make_www_cache_ts($information); } else if ($this->config->item('site_code') == 'guilin') { $this->make_www_cache_gl($information); + } else if ($this->config->item('site_code') == 'hly') { + $this->make_www_cache_hly($information); } else if ($this->config->item('site_code') == 'gh') { $this->make_www_cache_gh('pc', $information, $recommand_information); $this->make_www_cache_gh('mobile', $information, $recommand_information); diff --git a/application/third_party/ctmobilefirst/controllers/api.php b/application/third_party/ctmobilefirst/controllers/api.php index 24274e51..649b3ef1 100644 --- a/application/third_party/ctmobilefirst/controllers/api.php +++ b/application/third_party/ctmobilefirst/controllers/api.php @@ -486,6 +486,15 @@ class Api extends CI_Controller { echo json_encode($list,JSON_UNESCAPED_UNICODE); } + + /** + * 获取所有录入一日游的列表(搜索页) + */ + function getSearchDaytripList(){ + $list = $this->api_model->getSearchDaytripList(); + echo json_encode($list,JSON_UNESCAPED_UNICODE); + } + } /* 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 1fc16118..b8ed370a 100644 --- a/application/third_party/ctmobilefirst/models/api_model.php +++ b/application/third_party/ctmobilefirst/models/api_model.php @@ -776,7 +776,7 @@ class Api_model extends CI_Model { )) AS code FROM information_ct.dbo.infoContents INNER JOIN information_ct.dbo.infoStructures ON ic_id = is_ic_id - WHERE is_sitecode ='shanghai' AND ic_status = 1 + WHERE is_sitecode ='".$this->WebCode."' AND ic_status = 1 and ic_id in (select im_ic_id from information_ct.dbo.infoMetas where im_key='meta_ct_page_type' and convert(varchar(100),im_value)='daytripdetail') ) "; @@ -845,6 +845,110 @@ class Api_model extends CI_Model { } + /** + * 获取所有录入一日游的列表(搜索页) + */ + function getSearchDaytripList(){ + $sql = "SELECT convert(varchar(100),( + SELECT TOP 1 im_value + FROM information_ct.dbo.infoMetas + WHERE im_key = 'meta_ct_page_value' + AND im_ic_id = ic_id + )) AS code + ,convert(varchar(100),( + SELECT TOP 1 im_value + FROM information_ct.dbo.infoMetas + WHERE im_key = 'meta_addon_picture' + AND im_ic_id = ic_id + )) AS pcPic + ,convert(varchar(100),( + SELECT TOP 1 im_value + FROM information_ct.dbo.infoMetas + WHERE im_key = 'meta_addon_picture_mobile' + AND im_ic_id = ic_id + )) AS mobilePic + ,ic_photo,ic_url,ic_url_title + FROM information_ct.dbo.infoContents + INNER JOIN information_ct.dbo.infoStructures ON ic_id = is_ic_id + WHERE is_sitecode ='".$this->WebCode."' AND ic_status = 1 + and ic_id in (select im_ic_id from information_ct.dbo.infoMetas where im_key='meta_ct_page_type' and convert(varchar(100),im_value)='daytripdetail') "; //信息平台开放的一日游列表 + + $query =$this->HT->query($sql); + + $resultJson = array(); + if ($query->num_rows() > 0) { + foreach ($query->result_array() as $row) { + $tourItem = new stdClass(); + $tourItem->code = $row["code"]; + // 优先级:mobilePic → pcPic → ic_photo → 默认图 + $tourItem->pic = !empty($row["mobilePic"]) ? $row["mobilePic"] + : (!empty($row["pcPic"]) ? $row["pcPic"] + : (!empty($row["ic_photo"]) ? $row["ic_photo"] : "/image/grey.gif")); + + $tourItem->url = $row["ic_url"]; + $tourItem->title = $row["ic_url_title"]; + + //价格 + $price = $this->getDaytripsPrice($row["code"],2); + // 处理价格: + // 1. 如果是 null,设为空字符串 "" + // 2. 如果是数字(如 100.0000),转为整数(100) + $tourItem->price = ($price === null) + ? "" + : (string)(int)floatval($price); + + + //类别信息 + $dayTripDetail = $this->getSearchDaytripDetail($row["code"]); + if (isset($dayTripDetail->PAG_Type)){ + $tourItem->type = strval($dayTripDetail->PAG_Type); + }else{ + $tourItem->type = ""; + } + //扩展类别 + if (isset($dayTripDetail->PAG_ExtendType)){ + $tourItem->extendType = $dayTripDetail->PAG_ExtendType; + }else{ + $tourItem->extendType = ""; + } + //时间 + if (isset($dayTripDetail->PAG_NeedTime)){ + $tourItem->needTime = $dayTripDetail->PAG_NeedTime; + }else{ + $tourItem->needTime = 0; + } + + + $resultJson[] = $tourItem; + } + } + + return $resultJson; + + } + + /*** + * 根据一日游编码获取录入一日游的详细信息(搜索页) + */ + function getSearchDaytripDetail($pagcode){ + $sql = " SELECT top 1 p2.PAG2_Name, p2.PAG2_Intro, P1.PAG_NeedTime,P1.PAG_SN, P1.PAG_Code, CItyInfo2.CII2_Name + ,P1.PAG_Type ,P1.PAG_ExtendType + 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 =".$this->CTLGC.") AND (p1.pag_dei_sn=".$this->dei_sn.") ) AND + (p2.PAG2_Check = 2) and (PAG_Code='".$pagcode."')"; + $query =$this->HT->query($sql); + + if ($query->num_rows() > 0) { + return $query->row(); + }else{ + return null; + } + } + + } /* End of file Api_model.php */ diff --git a/application/views/mobile_first/shanghai-tour-list.php b/application/views/mobile_first/shanghai-tour-list.php index 1abc9123..08c7c51e 100644 --- a/application/views/mobile_first/shanghai-tour-list.php +++ b/application/views/mobile_first/shanghai-tour-list.php @@ -10,25 +10,38 @@
Days
- + +
+
+
+
Price
+
+ + +
@@ -56,35 +69,34 @@