From 7e8c3c0f6e14fbf9c1e496213f1970c9451761fe Mon Sep 17 00:00:00 2001
From: Jimmy Liow <18777396951@163.com>
Date: Tue, 20 Jun 2023 10:06:42 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AF=BB=E5=8F=96=E6=B3=B0?=
=?UTF-8?q?=E5=9B=BD30=E6=9D=A1=E5=8F=8D=E9=A6=88=E5=86=85=E5=AE=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
application/controllers/information.php | 41 +++++++++++++++++++++++++
application/models/feedback_model.php | 6 ++--
2 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/application/controllers/information.php b/application/controllers/information.php
index 5385bd72..71039b7b 100644
--- a/application/controllers/information.php
+++ b/application/controllers/information.php
@@ -1031,6 +1031,24 @@ class Information extends CI_Controller
var_dump($feedback_newest);
}
+ public function test_feedback30()
+ {
+ $feedback30_array = [];
+ preg_match_all('^^', '
', $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_content = $this->load->view(
+ $template_path . '-feedback-30-list',
+ array('feedback_list' => $feedback_list),
+ true
+ );
+ echo $feedback_content;
+ }
+ }
+ }
+
public function test_price()
{
$price_rule = '#ah-8,st,2#
#ah-8,st,2#
';
@@ -1675,6 +1693,29 @@ class Information extends CI_Controller
}
}
+ // 动态加载反馈标签,每个城市不足三十条反馈。
+ // HTLM:
+ // 解析结果:; Thailand
+ $feedback30_array = [];
+ preg_match_all('^^', $information->ic_content, $feedback30_array);
+ if (!empty($feedback30_array)) {
+ foreach ($feedback30_array[0] as $index => $tag_name) {
+ $city_name_string = $feedback30_array[1][$index];
+ $city_name_list = explode(',', $city_name_string);
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list);
+ $feedback_content = $this->load->view(
+ $template_path . '-feedback-30-list',
+ array('feedback_list' => $feedback_list),
+ true
+ );
+ $information->ic_content = str_replace(
+ $tag_name,
+ $feedback_content,
+ $information->ic_content
+ );
+ }
+ }
+
$feedback_newest = $this->Feedback_model->get_feedback_newest();
$feedback_newest_content = $this->load->view(
$template_path . '-feedback-newest',
diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php
index e270ad81..51f4e74d 100644
--- a/application/models/feedback_model.php
+++ b/application/models/feedback_model.php
@@ -158,13 +158,13 @@ class Feedback_model extends CI_Model {
}
/**
- * 根据城市英文名查找最新一条反馈信息
+ * 根据城市英文名查找反馈信息
*/
- function get_feedback_by_city($city_name) {
+ function get_feedback_by_city_name($city_name) {
$feedback_query =
$this->HT->query("
- select top 1
+ select top 30
tad_content, tai_customerid, tai_title, tai_getdate, tai_url, vci.cii2_name
from Eva_TAInfo
left join Eva_TADetail on TAD_TAI_SN=TAI_SN