Authored by yangyang

判断是否显示new,sale标签

... ... @@ -77,7 +77,7 @@ class HelperSearch
unset(self::$params['page']);
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
//产品列表
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options) : array();
//总页数
$result['page_total'] = isset($data['product']['page_total']) ? $data['product']['page_total'] : '';
self::$pageTotal = $result['page_total'];
... ... @@ -148,7 +148,7 @@ class HelperSearch
* @author sefon 2015-12-21 17:24:04
* @return array
*/
public static function getProductList($product, $imgSize)
public static function getProductList($product, $options)
{
$params = self::$params;
$goods = array();
... ... @@ -168,6 +168,15 @@ class HelperSearch
//再到着
//年终大促
// 年中大促
if ($options['controller'] == 'List' && $options['action'] == 'new') {
$isNew = false;
$isSale = false;
//TODO再到着不显示
}
if ($options['controller'] == 'List' && $options['action'] == 'sale') {
$isNew = false;
$isSale = false;
}
$gender = 0;
if (isset(self::$options['gender'])) {
$genderArr = explode(',', self::$options['gender']);
... ... @@ -190,7 +199,7 @@ class HelperSearch
}
}
if (!empty($val['default_images'])) {
$val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]);
$val['default_images'] = Images::getImageUrl($val['default_images'],$options['imgSize'][0],$options['imgSize'][1]);
}
//搜索关键字高亮
if (isset(self::$params['query']) && !empty(self::$params['query']) && preg_match("/".self::$params['query']."/i", $val['product_name'], $match)) {
... ...