From 79a46fd76ecdb524b53732f3bbc992fcd0a787b1 Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Thu, 11 May 2023 15:49:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=B7=E6=A0=BC=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 6 ++---- application/libraries/Currency.php | 4 ++-- application/models/PrimeLinePrice_model.php | 4 +++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index a38d5eef..c31eb8eb 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -999,7 +999,7 @@ class Information extends CI_Controller { $price_rule = '#ah-8,st,2#';//'#'.$meta_product_code.',st,2#'; $tag_price = $this->replace_price_tag($price_rule); - var_dump($tag_price); + echo 'Price: '.$tag_price; } /*! @@ -1012,14 +1012,12 @@ class Information extends CI_Controller public function replace_price_tag($price_content) { $price_item_array = $this->price_pregmatch($price_content); - var_dump($price_item_array); if ( ! empty($price_item_array)) { foreach ($price_item_array as $price_item) { $price_date = !empty($price_item->price_date) ? $price_item->price_date : date('Y-m-d', time() + 86400 * 7); //当前时间7天后的价格 $price_number = ''; //优先读取新的价格体系 $price = $this->PrimeLinePrice_model->search($price_item->cli_no, 1, $price_item->cli_grade, $price_item->person_size, $price_date); - var_dump($price); if (!empty($price)) { switch (strtoupper($price_item->price_people)) { case 'A': @@ -1095,7 +1093,7 @@ class Information extends CI_Controller } } } - $site_money = $this->currency->GetSiteMoney($price_number); + $site_money = $this->currency->GetSiteMoney($price_number, 'USD'); $site_money = $this->currency->calc_show_price($site_money); //把金额格式化为带有逗号(,)方便阅读,如 12,345 $price_number = is_numeric($price_number) ? number_format($site_money) : $price_number; diff --git a/application/libraries/Currency.php b/application/libraries/Currency.php index 1c3775e2..fb145c04 100644 --- a/application/libraries/Currency.php +++ b/application/libraries/Currency.php @@ -46,7 +46,7 @@ class Currency { } //根据人民币转换成站点对应的货币 - public function GetSiteMoney($RMB) { + public function GetSiteMoney($RMB, $fromCurrency) { if (!is_numeric($RMB)) { return $RMB; @@ -54,7 +54,7 @@ class Currency { $result = $RMB; if (is_numeric($RMB)) { - switch (CONST_SITE_CURRENCY) { + switch ($fromCurrency) { case 'USD': $result = $RMB / $this->USD_Rate; break; diff --git a/application/models/PrimeLinePrice_model.php b/application/models/PrimeLinePrice_model.php index 752e5a25..b167cb2e 100644 --- a/application/models/PrimeLinePrice_model.php +++ b/application/models/PrimeLinePrice_model.php @@ -8,6 +8,8 @@ class PrimeLinePrice_model extends CI_Model { var $cli_grade = 7001; //(标准7001、豪华7002、经济7003) var $price_date = false; //查询价格日期区间 var $orderby = false; + // AH: 28 + var $DEI_SN = 28; function __construct() { parent::__construct(); @@ -91,7 +93,7 @@ class PrimeLinePrice_model extends CI_Model { $this->cli_grade ? $sql.=$this->cli_grade : false; $this->orderby ? $sql.=$this->orderby : false; - $query = $this->HT->query($sql,array(14,$this->cli_no)); + $query = $this->HT->query($sql,array($DEI_SN,$this->cli_no)); if ($this->topnum === 1) { if ($query->num_rows() > 0) { $row = $query->row();