增加多个价格测试,增加部门SN参数

hotfix/paypal-note
Jimmy Liow 2 years ago
parent d8100905c9
commit 79192d5628

@ -997,23 +997,23 @@ class Information extends CI_Controller
public function test_price() public function test_price()
{ {
$price_rule = '<div style="color: red;">#ah-8,st,2#</div>'; $price_rule = '<div style="color: red;">#ah-8,st,2#</div><div style="color: red;">#ah-8,st,2#</div>';
$price_tag_list = $this->parse_price_tag($price_rule); $price_tag_list = $this->parse_price_tag($price_rule);
var_dump($price_tag_list); var_dump($price_tag_list);
} }
/*! /*!
* 页面中有价格标签,查出价格并替换内容 * 页面中有价格标签,查出价格并替换内容
* @author LYT <lyt@hainatravel.com> * @author LiaoYijun
* @date 2017-07-14 * @date 2023-05-12
* @param string $price_content 包含价格标签的内容 * @param string $price_content 包含价格标签的内容
* @return string 可读的价格字符串 * @return array 包含价格与占位符的数组
*/ */
public function parse_price_tag($price_content) public function parse_price_tag($price_content)
{ {
$price_item_array = $this->price_pregmatch($price_content); $price_item_array = $this->price_pregmatch($price_content);
$price_tag_list = []; $price_tag_list = [];
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 = '';
@ -1101,14 +1101,13 @@ class Information extends CI_Controller
if (!empty($price_number)) { if (!empty($price_number)) {
$price_tag = [ $price_tag = [
'placeholder' => $price_item->placeholder, 'placeholder' => $price_item->placeholder,
'price_number' => $price_item->price_number, 'price_number' => $price_number,
]; ];
$price_tag_list[] = $price_tag; $price_tag_list[] = $price_tag;
//$price_content = str_replace($price_item->placeholder, $price_number, $price_content);
} }
} }
} }
return $price_content; return $price_tag_list;
} }
//使用正则匹配出价格标签,返回一个价格数组 //使用正则匹配出价格标签,返回一个价格数组

@ -25,7 +25,7 @@ class PrimeLinePrice_model extends CI_Model {
$this->orderby = ' ORDER BY plp.PLP_Level ASC,plp.PLP_IsWeekPrice DESC,plp.PLP_AdultUnitPrice DESC '; $this->orderby = ' ORDER BY plp.PLP_Level ASC,plp.PLP_IsWeekPrice DESC,plp.PLP_AdultUnitPrice DESC ';
} }
public function search($cli_no, $topnum = false, $cli_grade = false, $person_size = false, $price_date = false) { public function search($cli_no, $topnum = false, $cli_grade = false, $person_size = false, $price_date = false, $DEI_SN = 28) {
$this->init(); $this->init();
$this->cli_no = $cli_no; $this->cli_no = $cli_no;
$this->topnum = empty($topnum) ? false : $topnum; $this->topnum = empty($topnum) ? false : $topnum;
@ -41,6 +41,7 @@ class PrimeLinePrice_model extends CI_Model {
) )
"; ";
} }
$this->DEI_SN = $DEI_SN;
return $this->get_list(); return $this->get_list();
} }
@ -93,7 +94,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($this->$DEI_SN,$this->cli_no)); $query = $this->HT->query($sql,array($this->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