...
|
...
|
@@ -125,7 +125,7 @@ class HelperSearch |
|
|
),
|
|
|
'goods' => $result['product_list'],
|
|
|
'allSort' => array(
|
|
|
'updateNum' => $result['filter']['group_sort']['all']['num'],
|
|
|
//'updateNum' => $result['filter']['group_sort']['all']['num'],
|
|
|
'list' => $result['filter']['group_sort']['list']
|
|
|
),
|
|
|
'advNav' => array(),
|
...
|
...
|
@@ -144,9 +144,20 @@ class HelperSearch |
|
|
public static function getProductList($product,$imgSize){
|
|
|
$result = array();
|
|
|
foreach($product as $key => $val){
|
|
|
//NEW
|
|
|
$isNew = $val['is_new'] == 'Y' ? true : false;
|
|
|
$isFew = $val['is_soon_sold_out'] == 'Y' ? true : false;
|
|
|
//限量商品
|
|
|
$isLimit = isset($val['is_limited']) && $val['is_limited'] === 'Y';
|
|
|
//即将售罄
|
|
|
$isFew = $val['is_soon_sold_out'] === 'Y' ? true : false;
|
|
|
$is_promotion = $val['is_promotion'];
|
|
|
|
|
|
//SALE
|
|
|
//新品节
|
|
|
//再到着
|
|
|
//年终大促
|
|
|
// 年中大促
|
|
|
|
|
|
foreach($val['goods_list'] as $k => $v){
|
|
|
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
|
|
|
}
|
...
|
...
|
@@ -156,13 +167,16 @@ class HelperSearch |
|
|
$result[] = array(
|
|
|
'tags' => array(
|
|
|
'isNew' => $isNew,
|
|
|
'isLimit' => $isLimit,
|
|
|
'isYearEndPromotion' => $is_promotion
|
|
|
),
|
|
|
'url' => $goods_list[0]['url'],
|
|
|
'thumb' => $val['default_images'],
|
|
|
'name' => $val['product_name'],
|
|
|
'salePrice' => $val['sales_price'],
|
|
|
'isFew' => $isFew
|
|
|
'marketPrice' => $val['market_price'],
|
|
|
'isFew' => $isFew,
|
|
|
'skn' => $val['product_skn']
|
|
|
);
|
|
|
}
|
|
|
return $result;
|
...
|
...
|
@@ -256,12 +270,6 @@ class HelperSearch |
|
|
* @param array $params
|
|
|
* @return array
|
|
|
*/
|
|
|
/**
|
|
|
* 组织搜索列表页面的左侧分类
|
|
|
* @param array $sort
|
|
|
* @param array $params
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function groupSort($sort, $option = array()) {
|
|
|
$params = self::$params;
|
|
|
$gender = isset($params['gender']) ? $params['gender'] : '';
|
...
|
...
|
@@ -295,8 +303,8 @@ class HelperSearch |
|
|
'sort_id' => 0,
|
|
|
'name' => '全部品类',
|
|
|
'href' => self::buildurl($query) ,
|
|
|
'num' => 0,
|
|
|
'selected' => ''
|
|
|
// 'num' => 0,
|
|
|
'active' => ''
|
|
|
) ,
|
|
|
'list' => array()
|
|
|
);
|
...
|
...
|
@@ -311,12 +319,12 @@ class HelperSearch |
|
|
))
|
|
|
);
|
|
|
}
|
|
|
$result['all']['num']+= $val['count'];
|
|
|
//$result['all']['num']+= $val['count'];
|
|
|
$msort = array(
|
|
|
'sort_id' => $val['sort_id'],
|
|
|
'name' => $val['sort_name'],
|
|
|
'num' => $val['count'],
|
|
|
'selected' => isset($params['msort']) && $params['msort'] == $val['sort_id'] ? true : false,
|
|
|
// 'num' => $val['count'],
|
|
|
'active' => isset($params['msort']) && $params['msort'] == $val['sort_id'] ? true : false,
|
|
|
'href' => self::buildurl(array_merge($query, array(
|
|
|
'msort' => $val['sort_id']
|
|
|
))) ,
|
...
|
...
|
@@ -328,8 +336,8 @@ class HelperSearch |
|
|
$sub[] = array(
|
|
|
'sort_id' => $val['sort_id'],
|
|
|
'name' => '全部' . $val['sort_name'],
|
|
|
'num' => $val['count'],
|
|
|
'selected' => !isset($params['misort']) && isset($params['msort']) && $params['msort'] == $val['sort_id'] ? true : false,
|
|
|
// 'num' => $val['count'],
|
|
|
'childActive' => !isset($params['misort']) && isset($params['msort']) && $params['msort'] == $val['sort_id'] ? true : false,
|
|
|
'href' => self::buildurl(array_merge($query, array(
|
|
|
'msort' => $val['sort_id']
|
|
|
))) ,
|
...
|
...
|
@@ -346,8 +354,8 @@ class HelperSearch |
|
|
$sub[] = array(
|
|
|
'sort_id' => $mval['sort_id'],
|
|
|
'name' => $mval['sort_name'],
|
|
|
'num' => $mval['count'],
|
|
|
'selected' => isset($params['misort']) && $params['misort'] == $mval['sort_id'] ? true : false,
|
|
|
// 'num' => $mval['count'],
|
|
|
'childActive' => isset($params['misort']) && $params['misort'] == $mval['sort_id'] ? true : false,
|
|
|
'href' => self::buildurl(array_merge($query, array(
|
|
|
'msort' => $val['sort_id'],
|
|
|
'misort' => $mval['sort_id']
|
...
|
...
|
@@ -448,7 +456,7 @@ class HelperSearch |
|
|
'name' => $v['brand_name'],
|
|
|
'alif' => $v['brand_alif'],
|
|
|
'href' => $url,
|
|
|
'selected' => in_array($v['id'], $brand_ids) ? true : false
|
|
|
'active' => in_array($v['id'], $brand_ids) ? true : false
|
|
|
);
|
|
|
|
|
|
if (count($result['default']) < 10) {
|
...
|
...
|
@@ -1058,6 +1066,8 @@ class HelperSearch |
|
|
* @return array
|
|
|
*/
|
|
|
public static function getDiscount(array $list = array()) {
|
|
|
$params = self::$params;
|
|
|
|
|
|
if (empty($list)) {
|
|
|
return array();
|
|
|
}
|
...
|
...
|
@@ -1077,11 +1087,11 @@ class HelperSearch |
|
|
$total+= $v['count'];
|
|
|
$query['p_d'] = $k;
|
|
|
$list[$k]['href'] = self::buildurl($query);
|
|
|
$list[$k]['num'] = $total;
|
|
|
$list[$k]['selected'] = isset($params['p_d']) && $params['p_d'] == $k ? true : false;
|
|
|
//$list[$k]['num'] = $total;
|
|
|
$list[$k]['active'] = isset($params['p_d']) && $params['p_d'] == $k ? true : false;
|
|
|
}
|
|
|
$result = array(
|
|
|
'updateNum' => $total,
|
|
|
//'updateNum' => $total,
|
|
|
'list' => $list
|
|
|
);
|
|
|
return $result;
|
...
|
...
|
@@ -1115,12 +1125,12 @@ class HelperSearch |
|
|
$query['shelve_time'] = '';
|
|
|
$query['shelve_time'] = $star_time.','.$end_time;
|
|
|
@$data[$i]['href'] = self::buildurl($query);
|
|
|
$data[$i]['num'] = $v;
|
|
|
//$data[$i]['num'] = $v;
|
|
|
$data[$i]['name'] = $k;
|
|
|
$i++;
|
|
|
}
|
|
|
$result = array(
|
|
|
'updateNum' => $total,
|
|
|
//'updateNum' => $total,
|
|
|
'list' => $data
|
|
|
);
|
|
|
return $result;
|
...
|
...
|
@@ -1150,4 +1160,23 @@ class HelperSearch |
|
|
}
|
|
|
return self::buildurl($param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 组织产品
|
|
|
* @param $product
|
|
|
* @param $options
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getProductPic($product, $options)
|
|
|
{
|
|
|
$result = array();
|
|
|
if (isset($product[0]['goods_list']) && !empty($product[0]['goods_list'])){
|
|
|
foreach ($product[0]['goods_list'] as $key => $val){
|
|
|
$result[$key]['coverImg'] = Images::getImageUrl($val['images_url'], $options['imgSize'][0], $options['imgSize'][1]);
|
|
|
$result[$key]['url'] = Helpers::getUrlBySkc($product[0]['product_id'], $val['goods_id'], $product[0]['cn_alphabet']);
|
|
|
$result[$key]['src'] = Images::getImageUrl($val['images_url'], $options['imgSize'][0], $options['imgSize'][1]);
|
|
|
}
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
} |
...
|
...
|
|