...
|
...
|
@@ -756,6 +756,8 @@ class Process |
|
|
$goodsList = empty($goodsList) ? array() : $goodsList['data']['product_list'];
|
|
|
$pos = 0;
|
|
|
$url = '';
|
|
|
$img = '';
|
|
|
$flag = false;
|
|
|
$oneGoods = array();
|
|
|
foreach ($goodsList as $goods) {
|
|
|
$oneGoods = array();
|
...
|
...
|
@@ -763,11 +765,28 @@ class Process |
|
|
if ($pos > 12) {
|
|
|
break;
|
|
|
}
|
|
|
if (empty($goods)) {
|
|
|
if (empty($goods['goods_list'])) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 判别默认的商品是否将默认的图片URL赋值到skn
|
|
|
$flag = false;
|
|
|
// 如果设置了默认图片,就取默认的图片
|
|
|
foreach ($goods['goods_list'] as $value) {
|
|
|
// 此skc是默认的,则将图片赋值给skn
|
|
|
if ($value['is_default'] === 'Y') {
|
|
|
$img = Helpers::procProductImg($value);
|
|
|
$flag = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
// 如果还未赋值,则取第一个skc产品的默认图片
|
|
|
if (!$flag) {
|
|
|
$img = Helpers::procProductImg($goods['goods_list'][0]);
|
|
|
}
|
|
|
$url = Helpers::getUrlBySkc($goods['product_id'], $goods['goods_list'][0]['goods_id'], $goods['cn_alphabet']);
|
|
|
$oneGoods['img'] = Images::getImageUrl($goods['goods_list'][0]['images_url'], 280, 373, 1);
|
|
|
|
|
|
$oneGoods['img'] = Images::getImageUrl($img, 280, 373, 1);
|
|
|
$oneGoods['name'] = $goods['product_name'];
|
|
|
$oneGoods['price'] = $goods['sales_price'];
|
|
|
$oneGoods['href'] = Helpers::transUrl($url, $type);
|
...
|
...
|
|