diff --git a/application/controllers/information.php b/application/controllers/information.php index 335ea5f8..86dc86a7 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -988,7 +988,7 @@ class Information extends CI_Controller 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_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 30, FALSE); $feedback_30_content = $this->load->view( 'mobile_first/ch-feedback-30-list', array('feedback_list' => $feedback_list), @@ -1011,7 +1011,7 @@ class Information extends CI_Controller $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_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5, FALSE); $data_name = str_replace(" ", "_", $city_name); $feedback_city_list[$data_name] = $feedback_list; } @@ -1543,7 +1543,7 @@ class Information extends CI_Controller public function test_feedback_city_list() { $feedback_city_array = []; - preg_match_all('^^', '
', $feedback_city_array); + preg_match_all('^^', '
', $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]; diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php index fcb60729..8a0edd0a 100644 --- a/application/models/feedback_model.php +++ b/application/models/feedback_model.php @@ -189,18 +189,8 @@ class Feedback_model extends CI_Model { /** * 根据城市英文名查找反馈信息 */ - function get_feedback_by_city_name($city_name, $top = 30) { - - // $feedback_query = - // $this->HT->query(" - // select top ? - // 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 - // left join V_CIty_Info vci on vci.cii_sn = tai_cii_sn and vci.LGC_LGC = 1 - // where TAD_Content is not null and vci.cii2_name = ? - // order by tai_getdate desc", - // array($top, $city_name)); + function get_feedback_by_city_name($city_name, $top = 30, $all=TRUE) { + $feedback_query = $this->HT->query(" select top ? @@ -212,6 +202,19 @@ class Feedback_model extends CI_Model { order by tai_getdate desc", array($top, $city_name)); + if ($all) { + $feedback_query = + $this->HT->query(" + select top ? + 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 + left join V_CIty_Info vci on vci.cii_sn = tai_cii_sn and vci.LGC_LGC = 1 + where TAD_Content is not null and vci.cii2_name = ? + order by tai_getdate desc", + array($top, $city_name)); + } + $feedback_result = $feedback_query->result(); $feedback_list = []; $customer_id_list = [];