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 起