diff --git a/application/controllers/information.php b/application/controllers/information.php index 432d599b..1fb5f01f 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -653,6 +653,18 @@ class Information extends CI_Controller } } + $feedback_newest = $this->Feedback_model->get_feedback_newest(); + $feedback_newest_content = $this->load->view( + $template_path . '-feedback-newest', + array('feedback_list' => $feedback_newest), + true + ); + $information->ic_content = str_replace( + '', + $feedback_newest_content, + $information->ic_content + ); + // 天气预报模板 $weather_forecast_content = $this->load->view( $template_path . '-weather-forecast', diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php index a488d08a..4e55f931 100644 --- a/application/models/feedback_model.php +++ b/application/models/feedback_model.php @@ -7,6 +7,40 @@ class Feedback_model extends CI_Model { $this->HT = $this->load->database('HT', TRUE); } + /** + * 返回最新八条反馈信息 + */ + function get_feedback_newest() { + + $feedback_query = + $this->HT->query(" + select top 8 + tad_content, tai_customerid, tai_title, tai_getdate, tai_url + from Eva_TAInfo + left join Eva_TADetail on TAD_TAI_SN=TAI_SN + where TAD_Content is not null + order by tai_getdate desc"); + + $feedback_result = $feedback_query->result(); + $feedback_list = []; + + foreach ($feedback_result as $feedback_row) { + $createdOn = new DateTime($feedback_row->tai_getdate); + $createdOnString = $createdOn->format('M Y'); + + $feedback = [ + 'title' => $feedback_row->tai_title, + 'customer' => $feedback_row->tai_customerid, + 'content' => $feedback_row->tad_content, + 'url' => $feedback_row->tai_url, + 'createdOn' => $createdOnString + ]; + $feedback_list[] = $feedback; + } + + return $feedback_list; + } + /** * 根据城市英文名查找最新八条反馈信息 */ diff --git a/application/views/mobile_first/ch-feedback-newest.php b/application/views/mobile_first/ch-feedback-newest.php new file mode 100644 index 00000000..0f479280 --- /dev/null +++ b/application/views/mobile_first/ch-feedback-newest.php @@ -0,0 +1,51 @@ +

+ + Tour Review + Based on 10,000+ reviews +

+
+ + + + + $feedback) {?> + + + + + +
+
+ +
+ , + +
+ +
+
+
\ No newline at end of file