Authored by runner

filter-age order

... ... @@ -501,7 +501,7 @@ class HelperSearch
$result['0']['checked'] = true;
}
return $result;
return self::ageSort($result);
}
/**
... ... @@ -1232,6 +1232,34 @@ class HelperSearch
}
/**
* 年龄排序,为了解决接口传的id顺序有问题
*/
public static function ageSort($agefilter)
{
foreach($agefilter as $key => $val){
if ($val['name'] === '中童'){
$mid = $val;
}
if ($val['name'] === '小童'){
$sml = $val;
}
}
if (!empty($mid) && !empty($sml)){
foreach($agefilter as $key => $val){
if ($val['name'] === '中童'){
$agefilter[$key] = $sml;
}
if ($val['name'] === '小童'){
$agefilter[$key] = $mid;
}
}
}
var_dump($agefilter);
return $agefilter;
}
/**
* 组织参数
* @param array $params 经过SearchModel::searchCondition()处理后的、用户输入的参数
* @return string
... ...