增加在GH网站根据顾问名字读取专属于顾问的反馈标签的功能

master
黄文强@HWQ-PC 11 months ago
parent d2a928510a
commit f3f63a65ec

@ -2002,6 +2002,28 @@ class Information extends CI_Controller
}
}
// 顾问英文名反馈标签
$feedback_advisor_array = [];
preg_match_all('/<!--@FEEDBACK_(.*)@-->/', $information->ic_content, $feedback_advisor_array);
if (!empty($feedback_advisor_array)) {
foreach ($feedback_advisor_array[0] as $index => $tag_name) {
$advisor_name = $feedback_advisor_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_advisor_name($advisor_name);
$feedback_content = $this->load->view(
'mobile_first/gh-feedback-advisor-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_content,
$information->ic_content
);
}
}
if (is_file('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css'));
} else {

@ -200,4 +200,56 @@ class Feedback_model extends CI_Model {
return $feedback_list;
}
/**
* 根据顾问英文名查找反馈信息
*/
function get_feedback_by_advisor_name($advisor_name) {
$feedback_query =
$this->HT->query("
select top 3
tad.tad_content,
tai.tai_customerid,
tai.tai_title,
tai.tai_getdate,
tai.tai_url,
vci.cii2_name
from Eva_TAInfo tai
join Eva_TADetail tad on tad.TAD_TAI_SN = tai.TAI_SN
join V_CIty_Info vci on vci.cii_sn = tai.tai_cii_sn and vci.LGC_LGC = 1
where tad.TAD_SN in (
select TAD_SN
from Eva_TADetail e
join V_Operator_Info v on e.TAD_ObjList like '%,' + cast(v.OPI_SN as varchar) + ',%'
where e.TAD_ObjType = 99002
and v.LGC_LGC = 1
and v.OPI2_Name = ?
)
order by tai.tai_getdate desc;
",
array($advisor_name));
$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');
if (!in_array($feedback_row->tai_customerid, $customer_id_list)) {
$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;
}
}

@ -0,0 +1,37 @@
<p style="text-align: center;margin-top: 80px;margin-bottom: 0;clear:both;">Discover real reviews of <a href="/about-us/highlights-travel-family">Highlights Travel Family</a>'s best-rated service across trusted platforms. </p>
<div class="visible-xs" style="margin: 20px 20px 110px 20px; ">
<img class="img-responsive" height="69" src="https://images.chinahighlights.com/allpicture/2024/07/22bf1a7554fc4906bdeaa6536ffe514b_cut_175x68_241_1719916246.png" style="float: left; width: 150px; margin: 0 auto;
display: block;" width="175" alt="Trip Advisor 2024 certificate">
<img height="40" src="https://data.asiahighlights.com/image/forms/ah-ch-gh-tp-rating.png" style="width: 120px; height: auto; display: block;
float: right;" width="211" alt="Tour Review">
</div>
<div class="table-responsive" style="margin-bottom: 20px; margin-top: 30px;">
<table style="width: max-content;">
<tbody>
<tr>
<td class="hidden-xs feedback_logo">
<img class="img-responsive" height="69" src="https://images.asiahighlights.com/allpicture/2024/04/b3e0271ca0874b7cb0342ea6f2987723_cut_175x68_241.jpg" style="margin: 0px auto; " width="175" alt="Tour Review"> <img alt="Tour Review" class="img-responsive" height="278" src="https://images.asiahighlights.com/allpicture/2024/04/0c58b3494bc04eeb9c5d3bdf55e55fad_cut_200x111_241.jpg" style="width: 170px; display: block; margin: 10px auto 0px; " width="1133">
</td>
<?php foreach ($feedback_list as $index => $feedback) {?>
<td class="tour_feedback feedback_content">
<strong>
<?php echo $feedback['title'] ?>
</strong>
<img src="<?php if (strpos($feedback['url'], 'trustpilot.com') == true) { echo 'https://images.asiahighlights.com/allpicture/2024/04/eba8a46e43514b55bb4e1dd15d9b5712_cut_211x40_241.jpg'; } else if (strpos($feedback['url'], 'tripadvisor.com') == true) { echo 'https://images.asiahighlights.com/allpicture/2024/04/8bebcc898ce54b64a46ced58580966d4_cut_104x19_241.jpg'; } ?>" style="height: 20px; width: auto;" alt="Tour Review">
<p>
<?php echo $feedback['content'] ?>
</p>
<a href="<?php echo $feedback['url'] ?>" target="_blank" rel="nofollow">More</a>
<div class="customer_name">
<?php echo $feedback['customer'] ?>, <?php echo $feedback['createdOn'] ?>
</div>
</td>
<?php }?>
</tr>
</tbody>
</table>
</div>
Loading…
Cancel
Save