...
|
...
|
@@ -20,175 +20,183 @@ class DetailModel |
|
|
/**
|
|
|
* 商品基本信息
|
|
|
*
|
|
|
* @param int $productId 商品ID
|
|
|
* @param int $productId 商品ID SKN 和 ID 只需要传一个
|
|
|
* @param int $goodsId 某个颜色的商品
|
|
|
* @param int $uid 当前登录用户ID, 未登录为0
|
|
|
* @param int $productSkn SKN 和 ID 只需要传一个
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getBaseInfo($productId, $goodsId, $uid, $vipLevel)
|
|
|
public static function getBaseInfo($productId, $goodsId, $uid, $vipLevel, $productSkn = null)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
$baseInfo = array();
|
|
|
// 通过ID获取
|
|
|
if (is_numeric($productId) && is_numeric($goodsId)) {
|
|
|
// 调用服务
|
|
|
$baseInfo = DetailData::baseInfo($productId, $uid);
|
|
|
}
|
|
|
// 通过SKN获取
|
|
|
elseif (is_numeric($productSkn)) {
|
|
|
$baseInfo = DetailData::baseInfo(null, $uid, $productSkn);
|
|
|
}
|
|
|
|
|
|
// 商品名称
|
|
|
if (isset($baseInfo['productName'])) {
|
|
|
$result['goodsName'] = $baseInfo['productName'];
|
|
|
}
|
|
|
// 商品名称
|
|
|
if (empty($baseInfo['productName'])) {
|
|
|
return $result;
|
|
|
}
|
|
|
$result['goodsName'] = $baseInfo['productName'];
|
|
|
|
|
|
// 商品促销短语
|
|
|
if (!empty($baseInfo['salesPhrase'])) {
|
|
|
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
|
|
|
}
|
|
|
// 商品促销短语
|
|
|
if (!empty($baseInfo['salesPhrase'])) {
|
|
|
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
|
|
|
}
|
|
|
|
|
|
// 商品标签
|
|
|
if (!empty($baseInfo['productTagBoList'])) {
|
|
|
foreach ($baseInfo['productTagBoList'] as $value) {
|
|
|
switch ($value['tagLabel']) {
|
|
|
case 'is_soon_sold_out': // 即将售磬
|
|
|
$result['tags']['is_soon_sold_out'] = true;
|
|
|
break;
|
|
|
case 'is_new': // 新品NEW
|
|
|
$result['tags']['is_new'] = true;
|
|
|
break;
|
|
|
case 'is_discount': // SALE
|
|
|
$result['tags']['is_discount'] = true;
|
|
|
break;
|
|
|
case 'is_limited': // 限量
|
|
|
$result['tags']['is_limited'] = true;
|
|
|
break;
|
|
|
case 'is_yohood': // YOHOOD
|
|
|
$result['tags']['is_yohood'] = true;
|
|
|
break;
|
|
|
case 'is_advance': // 再到着
|
|
|
$result['tags']['is_advance'] = true;
|
|
|
break;
|
|
|
}
|
|
|
// 商品标签
|
|
|
if (!empty($baseInfo['productTagBoList'])) {
|
|
|
foreach ($baseInfo['productTagBoList'] as $value) {
|
|
|
switch ($value['tagLabel']) {
|
|
|
case 'is_soon_sold_out': // 即将售磬
|
|
|
$result['tags']['is_soon_sold_out'] = true;
|
|
|
break;
|
|
|
case 'is_new': // 新品NEW
|
|
|
$result['tags']['is_new'] = true;
|
|
|
break;
|
|
|
case 'is_discount': // SALE
|
|
|
$result['tags']['is_discount'] = true;
|
|
|
break;
|
|
|
case 'is_limited': // 限量
|
|
|
$result['tags']['is_limited'] = true;
|
|
|
break;
|
|
|
case 'is_yohood': // YOHOOD
|
|
|
$result['tags']['is_yohood'] = true;
|
|
|
break;
|
|
|
case 'is_advance': // 再到着
|
|
|
$result['tags']['is_advance'] = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 商品价格
|
|
|
if (isset($baseInfo['productPriceBo'])) {
|
|
|
$result['goodsPrice'] = array();
|
|
|
$result['goodsPrice']['currentPrice'] = $baseInfo['productPriceBo']['formatSalesPrice'];
|
|
|
if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) {
|
|
|
$result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice'];
|
|
|
}
|
|
|
// 商品价格
|
|
|
if (isset($baseInfo['productPriceBo'])) {
|
|
|
$result['goodsPrice'] = array();
|
|
|
$result['goodsPrice']['currentPrice'] = $baseInfo['productPriceBo']['formatSalesPrice'];
|
|
|
if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) {
|
|
|
$result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice'];
|
|
|
}
|
|
|
// VIP商品价格
|
|
|
if (isset($baseInfo['productPriceBo']['vipPrices'])) {
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
|
|
|
$build['level'] = $value['vipLevel'];
|
|
|
$build['text'] = $value['vipPrice'];
|
|
|
$build['currentLevel'] = ($value['vipLevel'] == $vipLevel) ? true : false;
|
|
|
$result['vipLevel']['list'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
// VIP商品价格
|
|
|
if (isset($baseInfo['productPriceBo']['vipPrices'])) {
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
|
|
|
$build['level'] = $value['vipLevel'];
|
|
|
$build['text'] = $value['vipPrice'];
|
|
|
$build['currentLevel'] = ($value['vipLevel'] == $vipLevel) ? true : false;
|
|
|
$result['vipLevel']['list'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 上市期
|
|
|
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
|
|
|
$result['periodOfMarket'] = $baseInfo['expectArrivalTime'] . '月';
|
|
|
}
|
|
|
// 上市期
|
|
|
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
|
|
|
$result['periodOfMarket'] = $baseInfo['expectArrivalTime'] . '月';
|
|
|
}
|
|
|
|
|
|
// 促销信息
|
|
|
if (isset($baseInfo['promotionBoList'])) {
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['promotionBoList'] as $value) {
|
|
|
$build['text'] = '【' . $value['promotionType'] . '】' . $value['promotionTitle'];
|
|
|
$result['goodsDiscount']['list'][] = $build;
|
|
|
}
|
|
|
// 促销信息
|
|
|
if (isset($baseInfo['promotionBoList'])) {
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['promotionBoList'] as $value) {
|
|
|
$build['text'] = '【' . $value['promotionType'] . '】' . $value['promotionTitle'];
|
|
|
$result['goodsDiscount']['list'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$result['feedbacks'] = array();
|
|
|
|
|
|
// 商品咨询
|
|
|
$result['feedbacks']['consultsNum'] = 0;
|
|
|
if (!empty($baseInfo['consultBoWrapper'])) {
|
|
|
$result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal'];
|
|
|
$result['feedbacks']['consults'] = array();
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['consultBoWrapper']['consultBoList'] as $value) {
|
|
|
$build['question'] = $value['ask'];
|
|
|
$build['time'] = $value['askTime'];
|
|
|
$build['answer'] = $value['answer'];
|
|
|
$result['feedbacks']['consults'][] = $build;
|
|
|
}
|
|
|
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
|
|
|
}
|
|
|
// 暂无咨询
|
|
|
else {
|
|
|
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
|
|
|
$result['feedbacks'] = array();
|
|
|
|
|
|
// 商品咨询
|
|
|
$result['feedbacks']['consultsNum'] = 0;
|
|
|
if (!empty($baseInfo['consultBoWrapper'])) {
|
|
|
$result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal'];
|
|
|
$result['feedbacks']['consults'] = array();
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['consultBoWrapper']['consultBoList'] as $value) {
|
|
|
$build['question'] = $value['ask'];
|
|
|
$build['time'] = $value['askTime'];
|
|
|
$build['answer'] = $value['answer'];
|
|
|
$result['feedbacks']['consults'][] = $build;
|
|
|
}
|
|
|
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
|
|
|
}
|
|
|
// 暂无咨询
|
|
|
else {
|
|
|
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
|
|
|
}
|
|
|
|
|
|
// 商品评价
|
|
|
$result['feedbacks']['commentsNum'] = 0;
|
|
|
if (!empty($baseInfo['commentBoWrapper'])) {
|
|
|
$result['feedbacks']['commentsNum'] = $baseInfo['commentBoWrapper']['commentTotal'];
|
|
|
$result['feedbacks']['comments'] = array();
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
|
|
|
$build['userName'] = $value['nickName'];
|
|
|
$build['desc'] = $value['colorName'] . '/' . $value['sizeName'];
|
|
|
$build['content'] = isset($value['content']) ? $value['content'] : '';
|
|
|
$build['time'] = $value['createTime'];
|
|
|
$result['feedbacks']['comments'][] = $build;
|
|
|
}
|
|
|
$result['feedbacks']['commentsUrl'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
|
|
|
// 商品评价
|
|
|
$result['feedbacks']['commentsNum'] = 0;
|
|
|
if (!empty($baseInfo['commentBoWrapper'])) {
|
|
|
$result['feedbacks']['commentsNum'] = $baseInfo['commentBoWrapper']['commentTotal'];
|
|
|
$result['feedbacks']['comments'] = array();
|
|
|
$build = array();
|
|
|
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
|
|
|
$build['userName'] = $value['nickName'];
|
|
|
$build['desc'] = $value['colorName'] . '/' . $value['sizeName'];
|
|
|
$build['content'] = isset($value['content']) ? $value['content'] : '';
|
|
|
$build['time'] = $value['createTime'];
|
|
|
$result['feedbacks']['comments'][] = $build;
|
|
|
}
|
|
|
$result['feedbacks']['commentsUrl'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
|
|
|
}
|
|
|
|
|
|
// 品牌信息
|
|
|
if (!empty($baseInfo['brand'])) {
|
|
|
$result['enterStore'] = array(
|
|
|
'img' => Helpers::getImageUrl($baseInfo['brand']['brandIco'], 47, 47),
|
|
|
'storeName' => $baseInfo['brand']['brandName'],
|
|
|
'url' => Helpers::url('', array(), $baseInfo['brand']['brandDomain'])
|
|
|
);
|
|
|
// 为你优选的链接
|
|
|
$result['preferenceUrl'] = Helpers::url('/product/detail/preference', array('productSkn' => $baseInfo['erpProductId'], 'brandId' => $baseInfo['brand']['id']), '');
|
|
|
}
|
|
|
// 品牌信息
|
|
|
if (!empty($baseInfo['brand'])) {
|
|
|
$result['enterStore'] = array(
|
|
|
'img' => Helpers::getImageUrl($baseInfo['brand']['brandIco'], 47, 47),
|
|
|
'storeName' => $baseInfo['brand']['brandName'],
|
|
|
'url' => Helpers::url('', array(), $baseInfo['brand']['brandDomain'])
|
|
|
);
|
|
|
// 为你优选的链接
|
|
|
$result['preferenceUrl'] = Helpers::url('/product/detail/preference', array('productSkn' => $baseInfo['erpProductId'], 'brandId' => $baseInfo['brand']['id']), '');
|
|
|
}
|
|
|
|
|
|
// 商品信息
|
|
|
if (!empty($baseInfo['goodsList'])) {
|
|
|
$colorGroup = array();
|
|
|
$sizeList = array();
|
|
|
$goodsGroup = array();
|
|
|
$thumbImageList = array();
|
|
|
$colorStorageGroup = array(); // 颜色分组的库存总数集合, 多个之间用/分隔
|
|
|
$sizeStorageStr = ''; // 尺码库存总数集合, 多个之间用/分隔
|
|
|
$colorStorageNum = 0;
|
|
|
$totalStorageNum = 0; // 总库存数
|
|
|
foreach ($baseInfo['goodsList'] as $value) {
|
|
|
$colorStorageNum = 0;
|
|
|
$sizeStorageStr = '';
|
|
|
|
|
|
// 商品分组
|
|
|
if (isset($value['goodsImagesList'])) {
|
|
|
foreach ($value['goodsImagesList'] as $goods) {
|
|
|
$goodsGroup[] = array(
|
|
|
'goodsId' => $goods['goodsId'],
|
|
|
'img' => $goods['imageUrl'],
|
|
|
);
|
|
|
}
|
|
|
// 商品信息
|
|
|
if (!empty($baseInfo['goodsList'])) {
|
|
|
$colorGroup = array();
|
|
|
$sizeGroup = array();
|
|
|
$goodsGroup = array();
|
|
|
$sizeList = array();
|
|
|
$thumbImageList = array();
|
|
|
$colorStorageGroup = array(); // 颜色分组的库存总数集合, 多个之间用/分隔
|
|
|
$sizeStorageStr = ''; // 尺码库存总数集合, 多个之间用/分隔
|
|
|
$colorStorageNum = 0;
|
|
|
$totalStorageNum = 0; // 总库存数
|
|
|
foreach ($baseInfo['goodsList'] as $value) {
|
|
|
$colorStorageNum = 0;
|
|
|
$sizeStorageStr = '';
|
|
|
|
|
|
// 商品分组
|
|
|
if (isset($value['goodsImagesList'])) {
|
|
|
foreach ($value['goodsImagesList'] as $goods) {
|
|
|
$goodsGroup[] = array(
|
|
|
'goodsId' => $goods['goodsId'],
|
|
|
'img' => $goods['imageUrl'],
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 商品的尺码列表
|
|
|
if (isset($value['goodsSizeBoList'])) {
|
|
|
foreach ($value['goodsSizeBoList'] as $size) {
|
|
|
$sizeList[] = array(
|
|
|
'id' => $size['id'],
|
|
|
'skuId' => $size['goodsSizeSkuId'],
|
|
|
'goodsId' => $size['goodsId'],
|
|
|
'colorId' => $value['colorId'],
|
|
|
'name' => $size['sizeName'],
|
|
|
'sizeNum' => $size['goodsSizeStorageNum'],
|
|
|
);
|
|
|
$colorStorageNum += intval($size['goodsSizeStorageNum']);
|
|
|
$sizeStorageStr .= $size['goodsSizeStorageNum'] . '/';
|
|
|
$colorStorageGroup[ $size['sizeName'] ][ $value['colorName'] ] = $size['goodsSizeStorageNum'];
|
|
|
}
|
|
|
// 商品的尺码列表
|
|
|
if (isset($value['goodsSizeBoList'])) {
|
|
|
foreach ($value['goodsSizeBoList'] as $size) {
|
|
|
$sizeList[$value['colorId']][] = array(
|
|
|
'id' => $size['id'],
|
|
|
'skuId' => $size['goodsSizeSkuId'],
|
|
|
'goodsId' => $size['goodsId'],
|
|
|
'colorId' => $value['colorId'],
|
|
|
'name' => $size['sizeName'],
|
|
|
'sizeNum' => $size['goodsSizeStorageNum'],
|
|
|
);
|
|
|
$colorStorageNum += intval($size['goodsSizeStorageNum']);
|
|
|
$sizeStorageStr .= $size['goodsSizeStorageNum'] . '/';
|
|
|
$colorStorageGroup[$size['sizeName']][$value['colorId']] = $size['goodsSizeStorageNum'];
|
|
|
}
|
|
|
|
|
|
// 颜色分组
|
...
|
...
|
@@ -200,75 +208,82 @@ class DetailModel |
|
|
'colorNum' => $colorStorageNum,
|
|
|
'sizeNumStr' => rtrim($sizeStorageStr, '/'),
|
|
|
);
|
|
|
|
|
|
// 缩略图
|
|
|
$thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60) );
|
|
|
|
|
|
// 统计尺码对应的各个颜色的库存量
|
|
|
foreach ($sizeList as &$sizeArr) {
|
|
|
$sizeArr['colorNumStr'] = implode('/', array_values($colorStorageGroup[ $sizeArr['name'] ]) );
|
|
|
}
|
|
|
|
|
|
// 商品库存总数
|
|
|
$totalStorageNum += $colorStorageNum;
|
|
|
}
|
|
|
|
|
|
// 商品图: 多个
|
|
|
if (isset($goodsGroup[1])) {
|
|
|
foreach ($goodsGroup as $value) {
|
|
|
$result['bannerTop']['list'][] = array(
|
|
|
'img' => Helpers::getImageUrl($value['img'], 450, 600)
|
|
|
);
|
|
|
// 缩略图
|
|
|
$thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60));
|
|
|
|
|
|
// 添加尺码对应的各个颜色的库存量
|
|
|
foreach ($sizeList as $colorId => $sizeArr) {
|
|
|
foreach ($sizeArr as $key => $value) {
|
|
|
$sizeList[$colorId][$key]['colorNumStr'] = implode('/', array_values($colorStorageGroup[$value['name']]));
|
|
|
}
|
|
|
}
|
|
|
// 商品图: 单个
|
|
|
elseif (isset($goodsGroup[0])) {
|
|
|
$result['bannerTop'] = array(
|
|
|
'img' => Helpers::getImageUrl($goodsGroup[0]['img'], 450, 600)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
// 商品库存总数
|
|
|
$totalStorageNum += $colorStorageNum;
|
|
|
}
|
|
|
|
|
|
// 悬浮的购物车信息
|
|
|
$result['cartInfo'] = array(
|
|
|
'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接
|
|
|
'numInCart' => 0,
|
|
|
'goodsInstore' => $baseInfo['storage'], // 库存量
|
|
|
);
|
|
|
$soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0);
|
|
|
$notForSale = $baseInfo['attribute'] == 2;
|
|
|
// 显示加入购物车链接
|
|
|
if (!$soldOut && !$notForSale) {
|
|
|
$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'] : '';
|
|
|
$result['cartInfo']['price'] = isset($result['goodsPrice']['previousPrice']) ? $result['goodsPrice']['previousPrice'] : '';
|
|
|
$result['cartInfo']['salePrice'] = isset($result['goodsPrice']['currentPrice']) ? $result['goodsPrice']['currentPrice'] : '';
|
|
|
$result['cartInfo']['totalNum'] = $totalStorageNum;
|
|
|
$result['cartInfo']['colors'] = $colorGroup;
|
|
|
$result['cartInfo']['sizes'] = $sizeList;
|
|
|
// 格式化尺码对应的各个颜色分组
|
|
|
foreach ($colorGroup as $value) {
|
|
|
$sizeGroup[]['size'] = $sizeList[ $value['id'] ];
|
|
|
}
|
|
|
// 非卖品
|
|
|
elseif ($notForSale) {
|
|
|
$result['cartInfo']['notForSale'] = true;
|
|
|
|
|
|
// 商品图: 多个
|
|
|
if (isset($goodsGroup[1])) {
|
|
|
foreach ($goodsGroup as $value) {
|
|
|
$result['bannerTop']['list'][] = array(
|
|
|
'img' => Helpers::getImageUrl($value['img'], 450, 600)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
// 已售磬
|
|
|
elseif ($soldOut) {
|
|
|
$result['cartInfo']['soldOut'] = true;
|
|
|
// 商品图: 单个
|
|
|
elseif (isset($goodsGroup[0])) {
|
|
|
$result['bannerTop'] = array(
|
|
|
'img' => Helpers::getImageUrl($goodsGroup[0]['img'], 450, 600)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 是否收藏
|
|
|
$result['isCollect'] = false;
|
|
|
if (isset($baseInfo['isCollect']) && $baseInfo['isCollect'] === 'Y') {
|
|
|
$result['isCollect'] = true;
|
|
|
}
|
|
|
// 悬浮的购物车信息
|
|
|
$result['cartInfo'] = array(
|
|
|
'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接
|
|
|
'numInCart' => 0,
|
|
|
'goodsInstore' => $baseInfo['storage'], // 库存量
|
|
|
);
|
|
|
$soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0);
|
|
|
$notForSale = $baseInfo['attribute'] == 2;
|
|
|
// 显示加入购物车链接
|
|
|
if (!$soldOut && !$notForSale) {
|
|
|
$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'] : '';
|
|
|
$result['cartInfo']['price'] = isset($result['goodsPrice']['previousPrice']) ? $result['goodsPrice']['previousPrice'] : '';
|
|
|
$result['cartInfo']['salePrice'] = isset($result['goodsPrice']['currentPrice']) ? $result['goodsPrice']['currentPrice'] : '';
|
|
|
$result['cartInfo']['totalNum'] = $totalStorageNum;
|
|
|
$result['cartInfo']['colors'] = $colorGroup;
|
|
|
$result['cartInfo']['sizes'] = $sizeGroup;
|
|
|
}
|
|
|
// 非卖品
|
|
|
elseif ($notForSale) {
|
|
|
$result['cartInfo']['notForSale'] = true;
|
|
|
}
|
|
|
// 已售磬
|
|
|
elseif ($soldOut) {
|
|
|
$result['cartInfo']['soldOut'] = true;
|
|
|
}
|
|
|
|
|
|
// 底部简介的URL链接
|
|
|
$result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html', null, '');
|
|
|
$result['id'] = $productId;
|
|
|
// 是否收藏
|
|
|
$result['isCollect'] = false;
|
|
|
if (isset($baseInfo['isCollect']) && $baseInfo['isCollect'] === 'Y') {
|
|
|
$result['isCollect'] = true;
|
|
|
}
|
|
|
|
|
|
// 底部简介的URL链接
|
|
|
$result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html', null, '');
|
|
|
$result['id'] = $productId;
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -355,10 +370,9 @@ class DetailModel |
|
|
foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) {
|
|
|
$item = array();
|
|
|
$sizeNameList[] = array('param' => $value['sizeName']);
|
|
|
if ($boyReference && ($gender == 1 || $gender == 3) ) {
|
|
|
if ($boyReference && ($gender == 1 || $gender == 3)) {
|
|
|
$referenceList[] = array('param' => empty($value['boyReferSize']['referenceName']) ? ' ' : $value['boyReferSize']['referenceName']);
|
|
|
}
|
|
|
elseif ($girlReference && ($gender == 2 || $gender == 3) ) {
|
|
|
} elseif ($girlReference && ($gender == 2 || $gender == 3)) {
|
|
|
$referenceList[] = array('param' => empty($value['girlReferSize']['referenceName']) ? ' ' : $value['girlReferSize']['referenceName']);
|
|
|
}
|
|
|
foreach ($value['sortAttributes'] as $attr) {
|
...
|
...
|
@@ -469,6 +483,7 @@ class DetailModel |
|
|
'</p>' => '',
|
|
|
'<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=",
|
|
|
'<img border="0" src=' => "<img border=\"0\" class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=",
|
|
|
'.jpg' => '.jpg?imageMogr2/thumbnail/750x/quality/90',
|
|
|
)),
|
|
|
);
|
|
|
}
|
...
|
...
|
|