...
|
...
|
@@ -31,7 +31,7 @@ class DetailModel |
|
|
|
|
|
if (is_numeric($productId) && is_numeric($goodsId)) {
|
|
|
// 调用服务
|
|
|
$baseInfo = DetailData::baseInfo($productId, $uid);
|
|
|
$baseInfo = DetailData::baseInfo($productId, $uid);
|
|
|
|
|
|
// 判断商品是否在架
|
|
|
if (empty($baseInfo['status'])) {
|
...
|
...
|
@@ -42,7 +42,7 @@ class DetailModel |
|
|
if (isset($baseInfo['productName'])) {
|
|
|
$result['goodsName'] = $baseInfo['productName'];
|
|
|
}
|
|
|
|
|
|
|
|
|
// 商品促销短语
|
|
|
if (!empty($baseInfo['salesPhrase'])) {
|
|
|
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
|
...
|
...
|
@@ -141,7 +141,7 @@ class DetailModel |
|
|
$build['time'] = $value['createTime'];
|
|
|
$result['feedbacks']['comments'][] = $build;
|
|
|
}
|
|
|
$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
|
|
|
//$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
|
|
|
}
|
|
|
|
|
|
// 品牌信息
|
...
|
...
|
@@ -211,12 +211,14 @@ class DetailModel |
|
|
// 悬浮的购物车信息
|
|
|
$result['cartInfo'] = array(
|
|
|
'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接
|
|
|
'addToCartUrl' => Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'), // 加入购物车链接
|
|
|
'numInCart' => 0,
|
|
|
'goodsInstore' => $baseInfo['storage'], // 库存量
|
|
|
'soldOut' => $baseInfo['storage'] == 0, // 已售磬
|
|
|
'notForSale' => $baseInfo['attribute'] == 2, // 非卖品
|
|
|
);
|
|
|
if (!$result['cartInfo']['soldOut'] && !$result['cartInfo']['notForSale']) {
|
|
|
$result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); // 加入购物车链接
|
|
|
}
|
|
|
|
|
|
// 是否收藏
|
|
|
$result['isCollect'] = false;
|
...
|
...
|
@@ -289,24 +291,23 @@ class DetailModel |
|
|
$boyReference = !empty($sizeInfo['productExtra']['boyReference']);
|
|
|
$girlReference = !empty($sizeInfo['productExtra']['girlReference']);
|
|
|
$gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3;
|
|
|
$referenceName = '参考尺码';
|
|
|
if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference) ) {
|
|
|
$referenceName = '参考尺码';
|
|
|
if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) {
|
|
|
$referenceName = '参考尺码';
|
|
|
}
|
|
|
elseif ($gender == 3 && $boyReference) {
|
|
|
} elseif ($gender == 3 && $boyReference) {
|
|
|
$referenceName = '参考尺码(男)';
|
|
|
}
|
|
|
elseif ($gender == 3 && $girlReference) {
|
|
|
} elseif ($gender == 3 && $girlReference) {
|
|
|
$referenceName = '参考尺码(女)';
|
|
|
}
|
|
|
|
|
|
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
|
|
|
|
|
|
$referenceList = array();
|
|
|
// 判断是否显示参考尺码
|
|
|
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']);
|
|
|
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']) && ($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == $gender || $sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == 3);
|
|
|
if ($showReference) {
|
|
|
$sizeNameList[1] = array('param' => $referenceName);
|
|
|
$referenceList[0] = array('param' => $referenceName);
|
|
|
}
|
|
|
$referenceList = array();
|
|
|
|
|
|
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
|
|
|
$sizeBoGroup = array(); // 尺码按ID分组
|
|
|
foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
|
|
|
$sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']);
|
...
|
...
|
@@ -416,6 +417,7 @@ class DetailModel |
|
|
'\r\n\t' => '',
|
|
|
'</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=",
|
|
|
)),
|
|
|
);
|
|
|
}
|
...
|
...
|
|