加转美元

ct-mobile-first
赵鹏 4 years ago
parent 21e1bf43a9
commit 3eaf46e175

@ -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";

Loading…
Cancel
Save