上海站线路列表页上线测试

master
赵鹏 10 months ago
parent 1da408cf79
commit 8d777c3f97

@ -3698,6 +3698,8 @@ class Information extends CI_Controller
//线路类型列表
$lineTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getLineTypeList/?webcode=shanghai"));
$dataTourList["lineTypeList"] = $lineTypeList;
$tourListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourList/?webcode=shanghai"));
$dataTourList["tourListData"] = $tourListData;
//替换模板
$template_page_tourlist = $this->load->view($template_path . '-tour-list', $dataTourList, true); //模板内容

@ -475,7 +475,7 @@ class Api extends CI_Controller {
*/
public function getTourList(){
$list = $this->api_model->getTourList();
echo json_encode($list,JSON_NUMERIC_CHECK);
echo json_encode($list,JSON_UNESCAPED_UNICODE);
}
}

@ -690,15 +690,35 @@ class Api_model extends CI_Model {
$tourItem->title = $row["ic_url_title"];
//价格
$tourItem->price = $this->getTourPrice($row["code"]);
$price = $this->getTourPrice($row["code"]);
// 处理价格:
// 1. 如果是 null设为空字符串 ""
// 2. 如果是数字(如 100.0000转为整数100
$tourItem->price = ($price === null)
? ""
: (string)(int)floatval($price);
//类别信息
$tourDetail = $this->getTourDetail($row["code"]);
if (isset($tourDetail->CLI_LineType)){
$tourItem->linetype = $tourDetail->CLI_LineType;
$tourItem->linetype = strval($tourDetail->CLI_LineType);
}else{
$tourItem->linetype = "";
}
//城市
if (isset($tourDetail->CLI2_PassCity)){
$tourItem->PassCity = $tourDetail->CLI2_PassCity;
}else{
$tourItem->PassCity = "";
}
//天数
if (isset($tourDetail->CLI2_PassCity)){
$tourItem->Days = $tourDetail->CLI_Days;
}else{
$tourItem->Days = 0;
}
$resultJson[] = $tourItem;
}
@ -713,7 +733,7 @@ class Api_model extends CI_Model {
* 获取对应编码的线路信息
*/
function getTourDetail($clino){
$sql = " SELECT top 1 CLI_LineType ,CLI_PackageClass,CLI_SN
$sql = " SELECT top 1 CLI_LineType ,CLI_PackageClass,CLI_SN,CLI2_PassCity,CLI_Days
FROM CustomerLineInfo INNER JOIN
CustomerLineInfo2 ON CustomerLineInfo.CLI_SN = CustomerLineInfo2.CLI2_CLI_SN
WHERE (CLI_DEI_SN=".$this->dei_sn.")

Loading…
Cancel
Save