修复价格查询错误

hotfix/paypal-note
Jimmy Liow 2 years ago
parent ceb57adbc4
commit 79a46fd76e

@ -999,7 +999,7 @@ class Information extends CI_Controller
{ {
$price_rule = '#ah-8,st,2#';//'#'.$meta_product_code.',st,2#'; $price_rule = '#ah-8,st,2#';//'#'.$meta_product_code.',st,2#';
$tag_price = $this->replace_price_tag($price_rule); $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) public function replace_price_tag($price_content)
{ {
$price_item_array = $this->price_pregmatch($price_content); $price_item_array = $this->price_pregmatch($price_content);
var_dump($price_item_array);
if ( ! empty($price_item_array)) { if ( ! empty($price_item_array)) {
foreach ($price_item_array as $price_item) { 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_date = !empty($price_item->price_date) ? $price_item->price_date : date('Y-m-d', time() + 86400 * 7); //当前时间7天后的价格
$price_number = ''; $price_number = '';
//优先读取新的价格体系 //优先读取新的价格体系
$price = $this->PrimeLinePrice_model->search($price_item->cli_no, 1, $price_item->cli_grade, $price_item->person_size, $price_date); $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)) { if (!empty($price)) {
switch (strtoupper($price_item->price_people)) { switch (strtoupper($price_item->price_people)) {
case 'A': 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); $site_money = $this->currency->calc_show_price($site_money);
//把金额格式化为带有逗号(,)方便阅读,如 12,345 //把金额格式化为带有逗号(,)方便阅读,如 12,345
$price_number = is_numeric($price_number) ? number_format($site_money) : $price_number; $price_number = is_numeric($price_number) ? number_format($site_money) : $price_number;

@ -46,7 +46,7 @@ class Currency {
} }
//根据人民币转换成站点对应的货币 //根据人民币转换成站点对应的货币
public function GetSiteMoney($RMB) { public function GetSiteMoney($RMB, $fromCurrency) {
if (!is_numeric($RMB)) if (!is_numeric($RMB))
{ {
return $RMB; return $RMB;
@ -54,7 +54,7 @@ class Currency {
$result = $RMB; $result = $RMB;
if (is_numeric($RMB)) { if (is_numeric($RMB)) {
switch (CONST_SITE_CURRENCY) { switch ($fromCurrency) {
case 'USD': case 'USD':
$result = $RMB / $this->USD_Rate; $result = $RMB / $this->USD_Rate;
break; break;

@ -8,6 +8,8 @@ class PrimeLinePrice_model extends CI_Model {
var $cli_grade = 7001; //(标准7001、豪华7002、经济7003 var $cli_grade = 7001; //(标准7001、豪华7002、经济7003
var $price_date = false; //查询价格日期区间 var $price_date = false; //查询价格日期区间
var $orderby = false; var $orderby = false;
// AH: 28
var $DEI_SN = 28;
function __construct() { function __construct() {
parent::__construct(); parent::__construct();
@ -91,7 +93,7 @@ class PrimeLinePrice_model extends CI_Model {
$this->cli_grade ? $sql.=$this->cli_grade : false; $this->cli_grade ? $sql.=$this->cli_grade : false;
$this->orderby ? $sql.=$this->orderby : 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 ($this->topnum === 1) {
if ($query->num_rows() > 0) { if ($query->num_rows() > 0) {
$row = $query->row(); $row = $query->row();

Loading…
Cancel
Save