From c56e08716f9705a4ec763e5e59b9598d07403789 Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Sun, 25 Jun 2023 10:12:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E9=9B=86=E5=90=88?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8F=8D=E9=A6=88=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 74 ++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index ada1596e..f45d277b 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -656,6 +656,28 @@ class Information extends CI_Controller } } + // 动态加载反馈标签,每个城市三十条反馈。 + // HTLM:
+ // 解析结果:; Bangkok + $feedback30_array = []; + preg_match_all('^^', $information->ic_content, $feedback30_array); + if (!empty($feedback30_array)) { + foreach ($feedback30_array[0] as $index => $tag_name) { + $city_name = $feedback30_array[1][$index]; + $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name); + $feedback_30_content = $this->load->view( + 'mobile_first/ch-feedback-30-list', + array('feedback_list' => $feedback_list), + true + ); + $information->ic_content = str_replace( + $tag_name, + $feedback_30_content, + $information->ic_content + ); + } + } + $feedback_newest = $this->Feedback_model->get_feedback_newest(); $feedback_newest_content = $this->load->view( $template_path . '-feedback-newest', @@ -1397,6 +1419,28 @@ class Information extends CI_Controller $information->ic_content = str_replace('', $tour_form_content, $information->ic_content); } + // 动态加载反馈标签,每个城市三十条反馈。 + // HTLM: + // 解析结果:; Bangkok + $feedback30_array = []; + preg_match_all('^^', $information->ic_content, $feedback30_array); + if (!empty($feedback30_array)) { + foreach ($feedback30_array[0] as $index => $tag_name) { + $city_name = $feedback30_array[1][$index]; + $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name); + $feedback_30_content = $this->load->view( + 'mobile_first/gh-feedback-30-list', + array('feedback_list' => $feedback_list), + true + ); + $information->ic_content = str_replace( + $tag_name, + $feedback_30_content, + $information->ic_content + ); + } + } + $feedback_newest = $this->Feedback_model->get_feedback_newest(); $feedback_newest_content = $this->load->view( $template_path . '-feedback-newest', @@ -1729,14 +1773,40 @@ class Information extends CI_Controller foreach ($feedback30_array[0] as $index => $tag_name) { $city_name = $feedback30_array[1][$index]; $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name); - $feedback_content = $this->load->view( + $feedback_30_content = $this->load->view( 'mobile_first/ah-feedback-30-list', array('feedback_list' => $feedback_list), true ); $information->ic_content = str_replace( $tag_name, - $feedback_content, + $feedback_30_content, + $information->ic_content + ); + } + } + + // 集合页面反馈标签 + $feedback_city_array = []; + preg_match_all('^^', $information->ic_content, $feedback_city_array); + if (!empty($feedback_city_array)) { + foreach ($feedback_city_array[0] as $index => $tag_name) { + $city_name_string = $feedback_city_array[1][$index]; + $city_name_list = explode(',', $city_name_string); + $feedback_city_list = []; + foreach ($city_name_list as $index => $city_name) { + $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5); + $feedback_city_list[$city_name] = $feedback_list; + } + + $feedback_city_content = $this->load->view( + 'mobile_first/ah-feedback-city-list', + $feedback_city_list, + true + ); + $information->ic_content = str_replace( + $tag_name, + $feedback_city_content, $information->ic_content ); } From 5a79a923edd9e4e1bccbf4f4cdd7f1e5ec58e6a3 Mon Sep 17 00:00:00 2001 From: candice