|
|
|
|
@ -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.")
|
|
|
|
|
|