Authored by runner

helperSearch.php update

@@ -491,6 +491,16 @@ class HelperSearch @@ -491,6 +491,16 @@ class HelperSearch
491 'checked' => isset(self::$params['ageLevel']) && self::$params['ageLevel'] == $href ? true : false 491 'checked' => isset(self::$params['ageLevel']) && self::$params['ageLevel'] == $href ? true : false
492 ); 492 );
493 } 493 }
  494 +
  495 + //如果只有一个选项,默认选中
  496 + if (count($filter['ageLevel'],COUNT_NORMAL) === 1){
  497 + self::$selected['ageLevel'] = array(
  498 + 'name' => $filter['ageLevel']['0']['name'],
  499 + 'href' => self::buildUrl($params)
  500 + );
  501 +
  502 + $result['0']['checked'] = true;
  503 + }
494 return $result; 504 return $result;
495 } 505 }
496 506