花梨鹰网站上线基础版

master
赵鹏 11 months ago
parent 1bd25b13f1
commit b95d75f01c

@ -5150,7 +5150,7 @@ class Information extends CI_Controller
$data = array();
#region 公用数据
$apiurl = "http://202.103.68.104:97/info.php"; //本地测试
$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
//$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@ -5205,7 +5205,7 @@ class Information extends CI_Controller
$arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "<div class=\"fixed-tm\"><a href=\"/forms/customize\" >Create My Trip</a></div>";
$data["FloatIcon"] = "<div class=\"fixed-tm\"><a href=\"/forms/customize\" >私人定制</a></div>";
} else {
$data["ISPRODUCT"] = "yes";
}
@ -5220,7 +5220,7 @@ class Information extends CI_Controller
//主样式表,内联模式
$apiweb="http://202.103.68.104:97"; //本地测试
//$apiweb = "https://data.guilinchina.net";
//$apiweb = "https://data.hualiyingtravel.com";
$cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '<style type="text/css">' . $main_css_string . '</style>';
@ -5253,15 +5253,24 @@ class Information extends CI_Controller
$data["ConstructionCode"] = $meta_construction_code;
}
$data["meta_index_set"]="";
$meta_index_set = get_meta($information->ic_id, 'meta_index_set');
if (!empty($meta_index_set)) {
$data["meta_index_set"] = '<meta name="robots" content="' . $meta_index_set . '" />';
}
//总JS为了方便以后js好维护必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js所以必须在这里进行判断
$addBaseJs = false;
$addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
$meta_ct_page_Carousel = get_meta($information->ic_id,'meta_ct_page_Carousel'); //是否有顶部轮播图
if ($meta_ct_page_price == "yes") {
$addBaseJs = true;
} else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") {
$addBaseJs = true;
}else if ($meta_ct_page_Carousel == "yes"){
$addBaseJs = true;
}
if ($addBaseJs) {
@ -5285,9 +5294,11 @@ class Information extends CI_Controller
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/getlist.js" defer></script>';
}
//天气
if (in_array($meta_ct_page_type, array('weatherpage'))) {
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/getweather.js" defer></script>';
//顶部轮播图
if ($meta_ct_page_Carousel == "yes"){
$addonJs .= '<script src="'.$apiweb.'/js/splide4/splide.min.js" defer></script>';
$addonJs .= '<script src="'.$apiweb.'/js/mobile-first/carouse.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/js/splide4/splide.min.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
}
//页面传递参数
@ -5320,15 +5331,60 @@ class Information extends CI_Controller
if (!empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/daytripdetail.js" defer></script>';
//$addonJs .= '<script src="'.$apiweb.'/js/mobile-first/flatpickr.js"></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/css3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
$template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
//使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
$DayTripData["picture_mobile"] = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$DayTripData["picture_pc"] = get_meta($information->ic_id, 'meta_addon_picture');
$DayTripData["TITLE"] = $information->ic_title;
$arrCAD = ['HLYCAD-S','HLYCAD-V','HLYCAD-P'];//水灯节
$arrTest = ['QM-9-A','QM-9-B','QM-9-C'];
if (in_array($productCode,$arrTest)){ //水灯节
/**替换左右结构的线路表单标签 2024-7-4*/
if (strpos($ic_content, '<!--@DAYTRIP-CAD-FORM@-->') !== false) {
//准备数据
$InfoData = new stdClass(); //传递用来计算的信息平台数据
//附加选项
$t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
$t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
$t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
$InfoData->t_excludedate = $t_excludedate;
$InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
$DayTripData["InfoData"] = $InfoData; //传递信息平台数据
$linktour = get_meta($information->ic_id, 'meta_trainspread_linktour'); //关联线路
if (!empty($linktour)){
$paramCode = $productCode.",".$linktour;
}else{
$paramCode = $productCode;
}
//产品汉特信息,测试地址http://202.103.68.104:61/info.php/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly&param=QM-9-A,QM-9-B,QM-9-C
$TourData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly&param=" . $paramCode));
$DayTripData["TourData"] = $TourData;
//替换模板
$template_form_daydetail = $this->load->view($template_path . '-cad-form', $DayTripData, true); //模板内容
$ic_content = str_replace('<!--@DAYTRIP-CAD-FORM@-->', $template_form_daydetail, $ic_content);
}
}
else if (1==2) { //默认,暂时没有
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/daytripdetail.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/css3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
$template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
//使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
}
}
if ($meta_ct_page_type == "tourdetail") {
//线路
@ -5339,23 +5395,26 @@ class Information extends CI_Controller
}
//获取cli_sn
$tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode."&webcode=guilin"));
$tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode."&webcode=hly"));
$data["clisn"] = $tourdata->clisn;
//获取price
$tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode."&webcode=guilin"));
$tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode."&webcode=hly"));
$dataform["tourprice"] = $tourprice->price;
//调取模板
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/tourdetail.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/css3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
}
//表单页
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform"))) {
$productType = $meta_ct_page_type;
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/form.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/css3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
@ -5407,9 +5466,26 @@ class Information extends CI_Controller
if ($meta_ct_page_type == "tourdetail") { //线路表单,左右结构,用标签来做
$dataform['device'] = $device;
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true);
$ic_content = str_replace('<!--@TOUR-FORM@-->', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
if (strpos($ic_content, '<!--@TOUR-FORM@-->') !== false) {
$InfoData = new stdClass(); //传递用来计算的信息平台数据
$t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
$t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
$t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
$InfoData->t_excludedate = $t_excludedate;
$InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
$InfoData->t_defaultDate = get_meta($information->ic_id, "meta_trippest_defaultDate");
$dataform["InfoData"] = $InfoData; //传递信息平台数据
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
$ic_content = str_replace('<!--@TOUR-FORM@-->', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
}
}
//两种设备分别调用两种模板 ,静态化

@ -412,6 +412,56 @@ class Api extends CI_Controller {
//print_r($localeMap[$WebCode]);
}
/**
* 获取对应产品的汉特详细信息
*/
public function getDaytripDetail(){
if (isset($_GET["param"])){
$param = $_GET["param"];
$list = new stdClass();
if (strpos($param,",")!== false){
$arrCode = explode(",",$param);
$pagecode = $arrCode[0];
}else{
$arrCode = array($param);
$pagecode = $param;
}
//基础信息,如果有关联,读取第一条产品
$list = $this->api_model->get_pagdetail($pagecode);
$i = 0 ;
$ProductList = array();
foreach ($arrCode as $value) {
$value = trim($value);
//循环读取每条产品的价格列表
$ProductList[$i] = new stdClass();
$ProductList[$i] ->productdetail = $this->api_model->get_pagdetail($value);
$priceData = $this->api_model->getDaytripPriceData($value);
$j = 0;
foreach($priceData as $row){
$PKP_AdultPrice = $row->PKP_AdultPrice;
$PKP_AdultPrice = $this->currency->convert_moneny_by_char($PKP_AdultPrice,"USD");
$PKP_ChildPrice = $row->PKP_ChildPrice;
$PKP_ChildPrice = $this->currency->convert_moneny_by_char($PKP_ChildPrice,"USD");
$priceData[$j]->PKP_AdultPrice = $PKP_AdultPrice;
$priceData[$j]->PKP_ChildPrice = $PKP_ChildPrice;
$j++;
}
$ProductList[$i] ->pricelist = $priceData;
$i++;
}
$list->productlist = $ProductList;
echo json_encode($list,JSON_NUMERIC_CHECK);
}else{
echo null;
}
}
}
/* End of file Api.php */

@ -470,6 +470,112 @@ class Api_model extends CI_Model {
return $this->InfoCT->query($sql, array($id,$oldUrl));
}
/**
* @description: 根据信息标题获取对应的翰特包价线路内容
* @param {string} $pagecode
* @return:
*/
function get_pagdetail($pagcode)
{
if (!is_string($pagcode)){
$pagcode="";
}
$sql = " SELECT top 1 P1.PAG_ExtendType, P1.PAG_NeedTime,p2.PAG2_Name,P1.PAG_SN,p2.PAG2_Attraction,
P1.PAG_Code,P1.PAG_Title, CItyInfo2.CII2_Name
,P1.PAG_Type
,PAG_Scheme
,PAG_GuideLan
,PAG2_TimeDetail
,p1.PAG_SourceType
,PAG2_Summary
FROM dbo.BIZ_PackageInfo P1 INNER JOIN
dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN INNER JOIN
dbo.CItyInfo2 ON P1.PAG_CII_SN = dbo.CItyInfo2.CII2_CII_SN AND
dbo.CItyInfo2.CII2_LGC=?
WHERE (p1.pag_dei_sn=" . $this->dei_sn . ") AND
(p2.PAG2_LGC = ?)
AND (isnull(P1.DeleteFlag,0)<>1)
AND (p1.PAG_Code = ?) ";
// AND (p2.PAG2_Check = 2)
// AND (isnull(P1.DeleteFlag,0) <>1) ";
if($this->CTLGC==2){
$cii2_lgc = 2;
}else{
$cii2_lgc = 1;
}
$query = $this->HT->query($sql, array($cii2_lgc,$this->CTLGC,$pagcode));
if ($query->num_rows() > 0) {
return $query->row();
} else {
return null;
}
}
/**
* 获取一日游产品的价格列表用来计算默认读取4年的价额前年去年今年明年
*/
function getDaytripPriceData($pagcode){
//1.先根据编码获取SN
$sql = "select top 1 PAG_SN from BIZ_PackageInfo p1
inner join BIZ_PackageInfo2 p2 on p1.PAG_SN = p2.PAG2_PAG_SN
where p1.pag_dei_sn = ?
and p2.PAG2_LGC = ?
and p1.PAG_Code = ?
--and p2.PAG2_Check = 2
AND (isnull(P1.DeleteFlag,0) <>1) ";
$query = $this->HT->query($sql,array($this->dei_sn,$this->CTLGC,$pagcode));
if ($query->num_rows()>0){
//2.根据SN获取获取一个供应商的ID不然所有供应商的价格都出来了。
$pagsn = $query->row()->PAG_SN;
$sql = "select top 10 PAG_DefaultVEI_SN,pkp_vei_sn ,*
from BIZ_PackagePrice
left join BIZ_PackageInfo on BIZ_PackageInfo.PAG_DefaultVEI_SN=BIZ_PackagePrice.PKP_VEI_SN
and BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN
where PKP_PAG_SN =?
order by isnull( BIZ_PackageInfo.PAG_DefaultVEI_SN,0) desc ,PKP_InvalidDate desc";
$query = $this->HT->query($sql,array($pagsn));
if ($query->num_rows()>0){
$veisn = $query->row()->pkp_vei_sn;
if (!empty($query->row()->PAG_DefaultVEI_SN)){
$veisn = $query->row()->PAG_DefaultVEI_SN;
}
}else{
$veisn=0;
}
//3.根据供应商ID获取对应价格列表
$sql = "SELECT PKP_PersonStart
,PKP_PersonStop
,'PKP_AdultPrice'=( Case When (PKP_AdultSpecialPrice>0 and PKP_AdultSpecialPrice<>PKP_AdultNetPrice) then PKP_AdultSpecialPrice else PKP_AdultNetPrice end)
,'PKP_ChildPrice'=( Case When (PKP_ChildSpecialPrice>0 and PKP_ChildSpecialPrice<>PKP_ChildNetPrice) then PKP_ChildSpecialPrice else PKP_ChildNetPrice end)
,convert(varchar(100),PKP_ValidDate,111) as PKP_ValidDate
,convert(varchar(100),PKP_InvalidDate,111) as PKP_InvalidDate
FROM BIZ_PackagePrice
WHERE PKP_PAG_SN = ?
AND PKP_VEI_SN = ?
AND PKP_InvalidDate>=DATEADD(YEAR,-2,GETDATE())
and Checked=2
ORDER BY PKP_PersonStart ";
$query = $this->HT->query($sql,array($pagsn,$veisn));
if ($query->num_rows()>0){
//4.价格列表返回
return $query->result();
}else {
return null;
}
}else{
return null;
}
}
}
/* End of file Api_model.php */

@ -2406,10 +2406,10 @@ $meta_subnavi_arr = array(
id="meta_trippest_defaultDate" />
</div>
</div>
<?php if ($information->ic_sitecode == "trainspread") {?>
<?php if ($information->ic_sitecode == "trainspread" || $information->ic_sitecode == "hly") {?>
<div class="row">
<div class="col-sm-8">
<label>TS产品关联这里做
<label>产品关联这里做
<a href="javascript:void(0);"
onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_trainspread_linktour', $('#meta_trainspread_linktour').val())"><i
class="text-muted glyphicon glyphicon-remove"></i></a>

Loading…
Cancel
Save