diff --git a/application/controllers/information.php b/application/controllers/information.php index d6c009b0..51a60fb1 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -22,10 +22,11 @@ class Information extends CI_Controller $this->load->model('Infoauthors_model'); $this->load->model('InfoSMS_model'); $this->load->model('recommends_and_tips_model'); + $this->load->model('trippest_model'); //trippest产品 $this->load->model('Feedback_model'); $this->load->library('Amplib'); //加载AMP处理类 $this->load->library('html_optimize_lib'); //加载HTML优化类 - + } public function index() @@ -629,13 +630,14 @@ class Information extends CI_Controller } } - //火车票搜索框添加 + //火车票搜索框添加 -- zp if ($information->is_parent_id == "278008234") { //本地测试的火车父类ID为:278035939 。网前为:278008234 $template_TrainSearch = $this->load->view($template_path . '-train-detail', null, TRUE); $template = str_replace('', $template_TrainSearch, $template); } + //非产品页面 $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); if (empty($meta_product_code)) { @@ -670,6 +672,109 @@ class Information extends CI_Controller $information->ic_content = str_replace('', $breadcrumb_content, $information->ic_content); } + + + //---day tours--- 20210922 zp + //本地 278035929 + //网前 278008224 + if ($information->is_parent_id == "278008224") { + if (!empty($meta_product_code)){ + //准备需要的数据 + $dataTrippest = []; + + $dataTrippest["ic_title"] = $information->ic_title; + //附加选项 + $t_Type = get_meta($information->ic_id, 'meta_trippest_type'); + if (isset($t_Type)){ + $dataTrippest["t_Type"] = $t_Type; + }else{ + $dataTrippest["t_Type"] = "general"; + } + + $t_package = get_meta($information->ic_id, 'meta_trippest_package'); + $dataTrippest["t_package"] = explode("|",$t_package); + $t_excludedate = get_meta($information->ic_id, 'meta_trippest_excludedate'); + $dataTrippest["t_excludedate"] = $t_excludedate; + $t_includedate = get_meta($information->ic_id, 'meta_trippest_includedate'); + $dataTrippest["t_includedate"] = $t_includedate; + $t_excludemonth = get_meta($information->ic_id, 'meta_trippest_excludemonth'); + $dataTrippest["t_excludemonth"] = $t_excludemonth; + $dataTrippest["t_limitperson"] = get_meta($information->ic_id, 'meta_trippest_limitperson'); + + //获取翰特对应信息 + $dataTrippest['PagDetail'] = $this->trippest_model->get_pagdetail($meta_product_code); + //所属那个目的地 select SYC_SN,SYC2_CodeDiscribe from dbo.V_System_Code where SYC_Type=132 and LGC_LGC=2 + // 132001 北京目的地 + // 132002 上海目的地 + // 132003 西安目的地 + // 132004 桂林目的地 + // 132005 成都目的地 + $PAG_SourceType = $dataTrippest['PagDetail']->PAG_SourceType; + switch ($PAG_SourceType){ + case '132001': + $dataTrippest['PAG_SourceType'] = "beijing"; + break; + case '132002': + $dataTrippest['PAG_SourceType'] = "shanghai"; + break; + case '132003': + $dataTrippest['PAG_SourceType'] = "xian"; + break; + case '132004': + $dataTrippest['PAG_SourceType'] = "guilin"; + break; + case '132005': + $dataTrippest['PAG_SourceType'] = "chengdu"; + break; + case '132006': + $dataTrippest['PAG_SourceType'] = "zhangjiajie"; + break; + case '132007': + $dataTrippest['PAG_SourceType'] = "huangshan"; + break; + default: + $dataTrippest['PAG_SourceType'] = ""; + break; + } + + //每周发团 + $PAG_Scheme = $dataTrippest['PagDetail']->PAG_Scheme; + $dataTrippest['PAG_Scheme'] = $PAG_Scheme; + //接送 + if ($dataTrippest["t_Type"]=="transfer" || 1==1) + { + $PagList = $this->trippest_model->GetTransfer($dataTrippest['PagDetail']->PAG_SN); + $dataTrippest["PagList"] = $PagList; + } + + //价格 + // $price = $this->trippest_model->get_price("BJALC-1",2); + $price = $this->trippest_model->get_price($dataTrippest['PagDetail']->PAG_Code,2); + $showPrice = ""; + if (!empty($price)){ + $PKP_AdultNetPrice = $price->PKP_AdultNetPrice; + $PKP_AdultSpecialPrice = $price->PKP_AdultSpecialPrice; + if ($PKP_AdultSpecialPrice>0){ + $showPrice = $PKP_AdultSpecialPrice; + }else{ + $showPrice = $PKP_AdultNetPrice; + } + } + $dataTrippest["showPrice"] = $showPrice; + + //替换内容 + $trippest_detail_template = $this->load->view($template_path . '-daytours-detail', $dataTrippest, true); + + // print_r($trippest_detail_template); + // die(); + $information->ic_content = str_replace('', $trippest_detail_template, $information->ic_content); + + } + } + + //---day tours end ---- + + //信息推荐 $template_recommand = $this->recommand_information($information); $template = str_replace('', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template); @@ -699,7 +804,7 @@ class Information extends CI_Controller $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); } - // 火车票首页搜索框 + // 火车票首页搜索框 --zp $template_TrainSearch = ""; if ($information->ic_url =="/china-trains/hometest.htm" || $information->ic_url=="/china-trains/"){ $template_TrainSearch = $this->load->view($template_path . '-train-index', null, TRUE); diff --git a/application/models/trippest_model.php b/application/models/trippest_model.php new file mode 100644 index 00000000..0a7d9a28 --- /dev/null +++ b/application/models/trippest_model.php @@ -0,0 +1,130 @@ +HT = $this->load->database('HT', TRUE); + } + + + /** + * @description: 根据信息标题获取对应的翰特包价线路内容 + * @param {string} $pagecode + * @return: + */ + function get_pagdetail($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 + 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=1 + WHERE (p1.pag_dei_sn=32) AND + (p2.PAG2_LGC = 1) + AND (isnull(P1.DeleteFlag,0)<>1) + AND (p1.PAG_Code = ?) "; + + // AND (p2.PAG2_Check = 2) + // AND (isnull(P1.DeleteFlag,0) <>1) "; + $query = $this->HT->query($sql,array($pagcode)); + if ($query->num_rows()>0){ + return $query->row(); + }else{ + return null; + } + + } + + /** + * @description: 根据一日游code获取对应人数的成人价格 + * @param {string} $pagecode 线路代码 + * @param int $personnum 人数 + * @return: + */ + function get_price($pagcode,$personnum){ + $sql = "select top 1 isnull(PKP_AdultNetPrice,0) as PKP_AdultNetPrice,isnull(PKP_AdultSpecialPrice,0) as PKP_AdultSpecialPrice + from BIZ_PackagePrice + inner join BIZ_PackageInfo on BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN + where BIZ_PackagePrice.Checked=2 + and (BIZ_PackageInfo.PAG_Code = ?) + AND (pag_dei_sn=32) + and ? between PKP_PersonStart and PKP_PersonStop + and CONVERT(varchar(12),getdate(),111) between pkp_validdate and pkp_invaliddate + order by PKP_PriceGrade "; + + $param = array($pagcode,$personnum); + + $query = $this->HT->query($sql,$param); + + if ($query->num_rows()>0){ + return $query->row(); + }else{ + $sql = " select top 1 isnull(PKP_AdultNetPrice,0) as PKP_AdultNetPrice,isnull(PKP_AdultSpecialPrice,0) as PKP_AdultSpecialPrice + + from BIZ_PackagePrice + inner join BIZ_PackageInfo on BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN + where BIZ_PackagePrice.Checked=2 + and (BIZ_PackageInfo.PAG_Code = ?) + AND (pag_dei_sn=32) + and ? between PKP_PersonStart and PKP_PersonStop + order by PKP_AdultNetPrice desc "; + $query = $this->HT->query($sql,$param); + if ($query->num_rows()>0){ + return $query->row(); + }else + { + return null; + } + + } + + } + + /** + * @description: 获取对应的接送产品列表 + * @param {type} + * @return: + */ + function GetTransfer($PagSn){ + $sql = "SELECT p2.PAG2_Name + ,P1.PAG_SN + ,p2.PAG2_Attraction + ,P1.PAG_Code + FROM dbo.BIZ_PackageInfo P1 + INNER JOIN dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN + WHERE p2.PAG2_LGC = 108 + AND P1.PAG_SN IN ( + SELECT BTE_Trade + FROM BIZ_PackageTree + WHERE BTE_TradeType = 11 + AND isnull(BTE_ParentID, 0) = 0 + AND BTE_Trade = ? + UNION + SELECT BTE_Trade + FROM BIZ_PackageTree + WHERE BTE_ParentID = ( + SELECT BTE_ID + FROM BIZ_PackageTree + WHERE BTE_TradeType = 11 + AND isnull(BTE_ParentID, 0) = 0 + AND BTE_Trade = ? + ) + ) order by PAG2_Order desc "; + + $param = array($PagSn, $PagSn); + $query = $this->HT->Query($sql,$param); + return $query->result(); + + } +} + +/* End of file Trippest_model.php */ diff --git a/application/views/mobile_first/ch-daytours-detail.php b/application/views/mobile_first/ch-daytours-detail.php new file mode 100644 index 00000000..607eae3f --- /dev/null +++ b/application/views/mobile_first/ch-daytours-detail.php @@ -0,0 +1,352 @@ + +
+ + + + +