You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
defined ( 'BASEPATH' ) OR exit ( 'No direct script access allowed' );
class Api extends CI_Controller {
public function __construct ()
{
parent :: __construct ();
$this -> load -> model ( 'api_model' );
}
public function index ()
{
echo ( " <1>api</h1> " );
}
/**
* @description: 返回一日游价格
* @param {*} $returntype
* @return {*}
* @Date Changed:
*/
public function getDaytripsPrice (){
$pagecode = $_GET [ " pagecode " ];
if ( isset ( $_GET [ " personnum " ])){
$personnum = $_GET [ " personnum " ];
} else {
$personnum = 2 ;
}
$result = $this -> api_model -> getDaytripsPrice ( $pagecode , $personnum );
echo json_encode ( $result );
}
/**
* @description: 获取精华线路价格( 2人等)
* @param {*}
* @return {*}
* @Date Changed:
*/
public function getTourPrice (){
if ( isset ( $_GET [ " param " ])){
$param = $_GET [ " param " ];
$result [ " status " ] = " ok " ;
$result [ " price " ] = $this -> api_model -> getTourPrice ( $param );
echo json_encode ( $result );
} else {
$result [ " status " ] = " no param " ;
echo json_encode ( $result );
}
}
}
/* End of file Api.php */