...
|
...
|
@@ -165,52 +165,40 @@ class HelperSearch |
|
|
return $goods;
|
|
|
}
|
|
|
foreach($product as $key => $val){
|
|
|
//NEW
|
|
|
$isNew = $val['is_new'] == 'Y' ? true : false;
|
|
|
//限量商品
|
|
|
$isLimit = isset($val['is_limited']) && $val['is_limited'] === 'Y';
|
|
|
//即将售罄
|
|
|
$isFew = $val['is_soon_sold_out'] === 'Y' ? true : false;
|
|
|
//SALE
|
|
|
$isSale = ($val['is_discount'] == 'Y') ? true : false;
|
|
|
//新品节
|
|
|
//再到着
|
|
|
//年终大促
|
|
|
// 年中大促
|
|
|
if ($options['controller'] == 'List' && $options['action'] == 'new') {
|
|
|
$isNew = false;
|
|
|
$isSale = false;
|
|
|
//TODO再到着不显示
|
|
|
}
|
|
|
if ($options['controller'] == 'List' && $options['action'] == 'sale') {
|
|
|
$isNew = false;
|
|
|
$isSale = false;
|
|
|
}
|
|
|
//SALE、NEW标签不共存
|
|
|
if ($isNew) {
|
|
|
$isSale = false;
|
|
|
if (!isset($val['goods_list']) || empty($val['goods_list'])) {
|
|
|
continue;
|
|
|
}
|
|
|
$gender = 0;
|
|
|
if (isset(self::$params['gender'])) {
|
|
|
$genderArr = explode(',', self::$params['gender']);
|
|
|
$gender = $genderArr[0];
|
|
|
}
|
|
|
//默认商品链接
|
|
|
$defaultGood = '';
|
|
|
foreach($val['goods_list'] as $k => $v){
|
|
|
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
|
|
|
//删除下架的商品
|
|
|
if ($v['status'] == 0) {
|
|
|
continue;
|
|
|
}
|
|
|
//男封
|
|
|
if (isset($v['cover_1']) && !empty($v['cover_1']) && $gender == 1) {
|
|
|
$val['default_images'] = $v['cover_1'];
|
|
|
$defaultGood = $v['goods_id'];
|
|
|
}
|
|
|
//女封
|
|
|
if (isset($v['cover_2']) && !empty($v['cover_2']) && $gender == 2) {
|
|
|
elseif (isset($v['cover_2']) && !empty($v['cover_2']) && $gender == 2) {
|
|
|
$val['default_images'] = $v['cover_2'];
|
|
|
$defaultGood = $v['goods_id'];
|
|
|
}
|
|
|
//筛选符合颜色条件的封面图片
|
|
|
if (isset($params['color']) && $params['color'] == $v['color_id']) {
|
|
|
$val['default_images'] = $v['images_url'];
|
|
|
$defaultGood = $v['goods_id'];
|
|
|
break;
|
|
|
}
|
|
|
$defaultGood = $defaultGood ? $defaultGood : $v['goods_id'];
|
|
|
}
|
|
|
$defaultUrl = Helpers::getUrlBySkc($val['product_id'], $defaultGood, $val['cn_alphabet']);
|
|
|
if (!empty($val['default_images'])) {
|
|
|
$val['default_images'] = Images::getImageUrl($val['default_images'],$options['imgSize'][0],$options['imgSize'][1]);
|
|
|
}
|
...
|
...
|
@@ -222,13 +210,38 @@ class HelperSearch |
|
|
}
|
|
|
$val['product_name'] = preg_replace($match, $replace, $val['product_name']);
|
|
|
}
|
|
|
//NEW
|
|
|
$isNew = $val['is_new'] == 'Y' ? true : false;
|
|
|
//限量商品
|
|
|
$isLimit = isset($val['is_limited']) && $val['is_limited'] === 'Y';
|
|
|
//即将售罄
|
|
|
$isFew = $val['is_soon_sold_out'] === 'Y' ? true : false;
|
|
|
//SALE
|
|
|
$isSale = ($val['is_discount'] == 'Y') ? true : false;
|
|
|
//新品节
|
|
|
//再到着
|
|
|
//年终大促
|
|
|
// 年中大促
|
|
|
if ($options['controller'] == 'List' && $options['action'] == 'new') {
|
|
|
$isNew = false;
|
|
|
$isSale = false;
|
|
|
//TODO再到着不显示
|
|
|
}
|
|
|
if ($options['controller'] == 'List' && $options['action'] == 'sale') {
|
|
|
$isNew = false;
|
|
|
$isSale = false;
|
|
|
}
|
|
|
//SALE、NEW标签不共存
|
|
|
if ($isNew) {
|
|
|
$isSale = false;
|
|
|
}
|
|
|
$good = array(
|
|
|
'tags' => array(
|
|
|
'isNew' => $isNew,
|
|
|
'isLimit' => $isLimit,
|
|
|
'isSale' => $isSale
|
|
|
),
|
|
|
'url' => self::fromPram($goods_list[0]['url'],++$key),
|
|
|
'url' => self::fromPram($defaultUrl,++$key),
|
|
|
'thumb' => $val['default_images'],
|
|
|
'name' => $val['product_name'],
|
|
|
'salePrice' => $val['sales_price'],
|
...
|
...
|
@@ -1195,12 +1208,15 @@ class HelperSearch |
|
|
$result = array();
|
|
|
if (isset($product[0]['goods_list']) && !empty($product[0]['goods_list'])){
|
|
|
foreach ($product[0]['goods_list'] as $key => $val){
|
|
|
if ($val['status'] == 0) {
|
|
|
continue;
|
|
|
}
|
|
|
$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;
|
|
|
return array_values($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|