...
|
...
|
@@ -27,6 +27,8 @@ class HelperSearch |
|
|
public static $selected = array();
|
|
|
//list分类面包屑
|
|
|
public static $listNav = array();
|
|
|
//
|
|
|
public static $specialsaleParam = array();
|
|
|
//设置导航
|
|
|
private static function setListNav()
|
|
|
{
|
...
|
...
|
@@ -149,6 +151,7 @@ class HelperSearch |
|
|
/**
|
|
|
* TODO 组织商品列表信息
|
|
|
* @param $product 接口返回商品列表
|
|
|
* @param $options 条件
|
|
|
* @author sefon 2015-12-21 17:24:04
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -350,10 +353,9 @@ class HelperSearch |
|
|
);
|
|
|
$sortList = array();
|
|
|
|
|
|
//specialsale_id参数加上
|
|
|
$specialsaleParam = array();
|
|
|
//加上specialsale_id参数
|
|
|
if (self::$options['controller'] == 'Sale') {
|
|
|
$specialsaleParam = array(
|
|
|
self::$specialsaleParam = array(
|
|
|
'specialsale_id' => isset(self::$params['specialsale_id']) ? self::$params['specialsale_id'] : ''
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -393,7 +395,7 @@ class HelperSearch |
|
|
if (isset($val['sub']) && !empty($val['sub'])) {
|
|
|
foreach ($val['sub'] as $k => $v) {
|
|
|
$sortList[$key]['childList'][$k+1]['name'] = $v['sort_name'];
|
|
|
$sortList[$key]['childList'][$k+1]['href'] = self::buildUrl(array_merge($gender, array('msort' => $val['sort_id'], 'misort' => $v['sort_id']), $specialsaleParam));
|
|
|
$sortList[$key]['childList'][$k+1]['href'] = self::buildUrl(array_merge($gender, array('msort' => $val['sort_id'], 'misort' => $v['sort_id']), self::$specialsaleParam));
|
|
|
$sortList[$key]['childList'][$k+1]['childActive'] = isset(self::$params['misort']) && self::$params['misort'] == $v['sort_id'] ? true : false;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -1045,6 +1047,7 @@ class HelperSearch |
|
|
if ($data) {
|
|
|
$result['conditions'] = $data;
|
|
|
$result['clearUrl'] = self::current();
|
|
|
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
...
|
...
|
@@ -1054,7 +1057,7 @@ class HelperSearch |
|
|
* @param array $list
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getDiscount(array $list = array())
|
|
|
public static function getDiscount($list = array())
|
|
|
{
|
|
|
$params = self::$params;
|
|
|
$query = array();
|
...
|
...
|
@@ -1109,6 +1112,9 @@ class HelperSearch |
|
|
public static function current()
|
|
|
{
|
|
|
$url = explode('?', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
|
|
if (!empty(self::$specialsaleParam)) {
|
|
|
$url[0] .= '?' . http_build_query(self::$specialsaleParam);
|
|
|
}
|
|
|
return $url[0];
|
|
|
}
|
|
|
/**
|
...
|
...
|
@@ -1385,4 +1391,65 @@ class HelperSearch |
|
|
}
|
|
|
return $url;
|
|
|
}
|
|
|
|
|
|
|
|
|
public static function stripTags($html) {
|
|
|
$search = array(
|
|
|
' ',
|
|
|
"'<script[^>]*?>.*?</script>'si",
|
|
|
"'<[\/\!]*?[^<>]*?>'si",
|
|
|
"'([\r\n])[\s]+'",
|
|
|
"'&(quot|#34|#034|#x22);'i",
|
|
|
"'&(amp|#38|#038|#x26);'i",
|
|
|
"'&(lt|#60|#060|#x3c);'i",
|
|
|
"'&(gt|#62|#062|#x3e);'i",
|
|
|
"'&(nbsp|#160|#xa0);'i",
|
|
|
"'&(iexcl|#161);'i",
|
|
|
"'&(cent|#162);'i",
|
|
|
"'&(pound|#163);'i",
|
|
|
"'&(copy|#169);'i",
|
|
|
"'&(reg|#174);'i",
|
|
|
"'&(deg|#176);'i",
|
|
|
"'&(#39|#039|#x27);'",
|
|
|
"'&(euro|#8364);'i",
|
|
|
"'&a(uml|UML);'",
|
|
|
"'&o(uml|UML);'",
|
|
|
"'&u(uml|UML);'",
|
|
|
"'&A(uml|UML);'",
|
|
|
"'&O(uml|UML);'",
|
|
|
"'&U(uml|UML);'",
|
|
|
"'ß'i",
|
|
|
"\n",
|
|
|
"\r",
|
|
|
"\t",
|
|
|
"\0",
|
|
|
" "
|
|
|
);
|
|
|
return trim(str_replace($search, '', strip_tags($html,"")));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 按字来切分字符 (UTF-8截字)
|
|
|
*
|
|
|
* @param String $str
|
|
|
* @param Integer $length
|
|
|
* @param Integer $start
|
|
|
* @param String $encoding
|
|
|
* @return String
|
|
|
*/
|
|
|
public static function mbSubstr($str, $length, $start = 0, $suffix = '...', $encoding = "utf-8") {
|
|
|
if (!is_string($str)) {
|
|
|
return $str;
|
|
|
}
|
|
|
$str = trim($str);
|
|
|
if (mb_strlen($str) == $length) {
|
|
|
return $str;
|
|
|
}
|
|
|
$strs = mb_substr($str, $start, $length, $encoding);
|
|
|
if ((mb_strlen($str) / 3) > $length) {
|
|
|
$strs .= $suffix;
|
|
|
}
|
|
|
return $strs;
|
|
|
}
|
|
|
} |
...
|
...
|
|