From 7c3d843abe588c205be588a85174ad33be15505b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Wed, 2 Jul 2025 15:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E7=BA=BF?= =?UTF-8?q?=E8=B7=AF=E4=BB=B7=E6=A0=BC=E5=8F=AF=E4=BB=A5=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=BA=BA=E6=B0=91=E5=B8=81=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctmobilefirst/controllers/api.php | 13 ++++++++++--- .../ctmobilefirst/models/api_model.php | 19 ++++++++++++------- .../views/mobile_first/hly-form-tourqi.php | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/application/third_party/ctmobilefirst/controllers/api.php b/application/third_party/ctmobilefirst/controllers/api.php index 649b3ef1..f01834e9 100644 --- a/application/third_party/ctmobilefirst/controllers/api.php +++ b/application/third_party/ctmobilefirst/controllers/api.php @@ -74,13 +74,20 @@ class Api extends CI_Controller { $param = $_GET["param"]; $result["status"]="ok"; $price = $this->api_model->getTourPrice($param); - $result["pricecn"]=$price; - if (is_numeric($price)){ - $price = $this->currency->calc_show_price($price); + + if (isset($price->CLP_TwoToFiveAdultPriceRMB)){ + $resultPricecn=$price->CLP_TwoToFiveAdultPriceRMB; + }else{ + $resultPricecn = 0; + } + + if (isset($price->CLP_TwoToFiveAdultPrice)){ + $price = $this->currency->calc_show_price($price->CLP_TwoToFiveAdultPrice); }else{ $price = "0"; } + $result["pricecn"]=(string)(int)floatval($resultPricecn); $result["price"] = $price; echo json_encode($result); }else{ diff --git a/application/third_party/ctmobilefirst/models/api_model.php b/application/third_party/ctmobilefirst/models/api_model.php index 1c05a49a..5f1d5a20 100644 --- a/application/third_party/ctmobilefirst/models/api_model.php +++ b/application/third_party/ctmobilefirst/models/api_model.php @@ -136,15 +136,15 @@ class Api_model extends CI_Model { }else { //普通线路价格 $sql = "select top 1 - CLI_SN,CLP_TwoToFiveAdultPrice,CLI_PackageClass + CLI_SN,CLP_TwoToFiveAdultPrice,CLI_PackageClass,CLP_TwoToFiveAdultPriceRMB FROM CustomerLineInfo INNER JOIN CustomerLinePrice ON CustomerLineInfo.CLI_SN = CustomerLinePrice.CLP_CLI_SN INNER JOIN CustomerLineInfo2 ON CustomerLineInfo.CLI_SN = CustomerLineInfo2.CLI2_CLI_SN - where CLI_SN= ? and CLI2_LGC=? and (CLP_Area=1 or CLP_Area=2) + where CLI_SN= ? and CLI2_LGC=? and (CLI_State = 1005004 or CLI_State = 1005003) ORDER BY CLP_TwoToFiveAdultPrice"; $query = $this->HT->query($sql,array($CLI_SN,$this->CTLGC)); if ($query->num_rows()>0){ - $reust = $query->row()->CLP_TwoToFiveAdultPrice; + $reust = $query->row(); } } @@ -210,8 +210,8 @@ class Api_model extends CI_Model { ORDER BY tball.sortBy ASC "; - $query = $this->HT->query($sql); - return $query->result(); + $query = $this->HT->query($sql); + return $query->result(); } @@ -697,12 +697,17 @@ class Api_model extends CI_Model { //价格 $price = $this->getTourPrice($row["code"]); + $resultPrice = 0; + if (isset($price->CLP_TwoToFiveAdultPrice)){ + $resultPrice = $price->CLP_TwoToFiveAdultPrice; + } + // 处理价格: // 1. 如果是 null,设为空字符串 "" // 2. 如果是数字(如 100.0000),转为整数(100) - $tourItem->price = ($price === null) + $tourItem->price = ($resultPrice === null) ? "" - : (string)(int)floatval($price); + : (string)(int)floatval($resultPrice); //类别信息 diff --git a/application/views/mobile_first/hly-form-tourqi.php b/application/views/mobile_first/hly-form-tourqi.php index d6b30d5b..38f401ce 100644 --- a/application/views/mobile_first/hly-form-tourqi.php +++ b/application/views/mobile_first/hly-form-tourqi.php @@ -7,7 +7,7 @@

价格基于2人私人旅游,四星/特色酒店住宿 的淡季价格

-

RMB ¥ p/p 起

+

RMB ¥ p/p 起