From 3eaf46e175599de7059fc2b19a54535b0161b464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Fri, 26 Mar 2021 17:09:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E8=BD=AC=E7=BE=8E=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/ctmobilefirst/controllers/api.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/third_party/ctmobilefirst/controllers/api.php b/application/third_party/ctmobilefirst/controllers/api.php index 43df2094..edd61cda 100644 --- a/application/third_party/ctmobilefirst/controllers/api.php +++ b/application/third_party/ctmobilefirst/controllers/api.php @@ -8,6 +8,7 @@ class Api extends CI_Controller { { parent::__construct(); $this->load->model('api_model'); + $this->load->library('Currency'); } @@ -48,7 +49,15 @@ class Api extends CI_Controller { if (isset($_GET["param"])){ $param = $_GET["param"]; $result["status"]="ok"; - $result["price"] = $this->api_model->getTourPrice($param); + $price = $this->api_model->getTourPrice($param); + $result["pricecn"]=$price; + if (is_numeric($price)){ + $price = $this->currency->calc_show_price($this->currency->convert_moneny_by_char($price,"USD")); + }else{ + $price = "0"; + } + + $result["price"] = $price; echo json_encode($result); }else{ $result["status"]="no param";