...
|
...
|
@@ -300,10 +300,9 @@ class DetailModel |
|
|
$notForSale = $baseInfo['attribute'] == 2;
|
|
|
|
|
|
// 显示加入购物车链接
|
|
|
if (!$soldOut && !$notForSale && !$isLimited) {
|
|
|
if (!$soldOut && !$notForSale) {
|
|
|
ksort($colorGroup, SORT_NUMERIC);
|
|
|
|
|
|
$result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html');
|
|
|
|
|
|
$result['cartInfo']['productId'] = $productId;
|
|
|
$result['cartInfo']['thumbs'] = $thumbImageList;
|
|
|
$result['cartInfo']['name'] = isset($result['goodsName']) ? $result['goodsName'] : '';
|
...
|
...
|
@@ -312,6 +311,25 @@ class DetailModel |
|
|
$result['cartInfo']['totalNum'] = $totalStorageNum;
|
|
|
$result['cartInfo']['colors'] = $colorGroup;
|
|
|
$result['cartInfo']['sizes'] = $sizeGroup;
|
|
|
|
|
|
// 限购商品
|
|
|
if ($isLimited) {
|
|
|
// 是否开售
|
|
|
$isBeginSale = (isset($baseInfo['saleStatus']) && $baseInfo['saleStatus'] == 1);
|
|
|
// 限购商品有关的展示状态
|
|
|
$showStatus = 1;
|
|
|
if (isset($baseInfo['showStatus'])) {
|
|
|
$showStatus = intval($baseInfo['showStatus']);
|
|
|
}
|
|
|
|
|
|
// 处理限购商品有关的按钮状态
|
|
|
self::procShowStatus($result, $showStatus, $isBeginSale);
|
|
|
|
|
|
$result['cartInfo']['limitProductCode'] = $baseInfo['limitProductCode'];
|
|
|
$result['cartInfo']['limitCodeUrl'] = self::getLimitCodeUrl($baseInfo['erpProductId']);
|
|
|
} else {
|
|
|
$result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html');
|
|
|
}
|
|
|
}
|
|
|
// 非卖品
|
|
|
elseif ($notForSale) {
|
...
|
...
|
@@ -321,22 +339,6 @@ class DetailModel |
|
|
elseif ($soldOut) {
|
|
|
$result['cartInfo']['soldOut'] = true;
|
|
|
}
|
|
|
// 限购商品
|
|
|
elseif ($isLimited) {
|
|
|
// 是否开售
|
|
|
$isBeginSale = (isset($baseInfo['saleStatus']) && $baseInfo['saleStatus'] == 1);
|
|
|
// 限购商品有关的展示状态
|
|
|
$showStatus = 1;
|
|
|
if (isset($baseInfo['showStatus'])) {
|
|
|
$showStatus = intval($baseInfo['showStatus']);
|
|
|
}
|
|
|
|
|
|
// 处理限购商品有关的按钮状态
|
|
|
self::procShowStatus($result, $showStatus, $isBeginSale);
|
|
|
|
|
|
$result['cartInfo']['limitProductCode'] = $baseInfo['limitProductCode'];
|
|
|
$result['cartInfo']['limitCodeUrl'] = self::getLimitCodeUrl($baseInfo['erpProductId']);
|
|
|
}
|
|
|
|
|
|
// 是否收藏
|
|
|
$result['isCollect'] = false;
|
...
|
...
|
|