diff --git a/application/controllers/information.php b/application/controllers/information.php index 1e5133eb..665c9042 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -985,14 +985,8 @@ class Information extends CI_Controller public function test_feedback() { - $feedback_newest = $this->Feedback_model->get_feedback_newest(); + $feedback_newest = $this->Feedback_model->test_feedback_newest(); var_dump($feedback_newest); - - $feedback_newest_content = $this->load->view( - 'ch-feedback-newest', - array('feedback_list' => $feedback_newest), - true); - var_dump($feedback_newest_content); } public function test_price() @@ -1673,30 +1667,6 @@ class Information extends CI_Controller file_put_contents($html_path, $template, LOCK_EX); } - public function test_ah_feedback() - { - $feedback_array = []; - preg_match_all('^^', '
', $feedback_array); - if (!empty($feedback_array)) { - foreach ($feedback_array[0] as $index => $tag_name) { - $city_name_string = $feedback_array[1][$index]; - $city_name_list = explode(',', $city_name_string); - $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list); - var_dump($feedback_list); - $feedback_content = $this->load->view( - 'mobile_first/ah' . '-feedback-list', - array('feedback_list' => $feedback_list), - true - ); - echo $feedback_content; - // $information->ic_content = str_replace( - // $tag_name, - // $feedback_content, - // $information->ic_content); - } - } - } - /** * @description: CT用的生成静态文件方法.有些内容的替换,CT这边不一样,需要单独处理 zp * @param {type} $device='mobile' or 'pc' diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php index df53d166..4f1939cc 100644 --- a/application/models/feedback_model.php +++ b/application/models/feedback_model.php @@ -41,6 +41,41 @@ class Feedback_model extends CI_Model { return $feedback_list; } + function test_feedback_newest() { + + $feedback_query = + $this->HT->query(" + select top 40 + 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 = []; + $customer_id_list = []; + + foreach ($feedback_result as $feedback_row) { + $createdOn = new DateTime($feedback_row->tai_getdate); + $createdOnString = $createdOn->format('M Y'); + $feedback_count = COUNT($feedback_list); + if (!array_key_exists($feedback_row->tai_customerid, $customer_id_list) && $feedback_count < 20) { + $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; + $customer_id_list[] = $feedback_row->tai_customerid; + } + } + + return $feedback_list; + } + /** * 根据城市英文名查找最新八条反馈信息 */ diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 85a49dc1..eee416f0 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -784,6 +784,32 @@ if (!empty($setting_website_nav)) { ic_sitecode == 'chinatravel') { ?> +