...
|
...
|
@@ -18,10 +18,10 @@ class ItemModel |
|
|
* @var array
|
|
|
*/
|
|
|
private static $multiResources = array();
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品信息
|
|
|
*
|
|
|
*
|
|
|
* @param string $productId
|
|
|
* @param string $goodsId
|
|
|
* @param string $uid
|
...
|
...
|
@@ -29,7 +29,7 @@ class ItemModel |
|
|
* @param string $productSkn
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getProductInfo($productId, $goodsId, $uid, $vipLevel = 0, $productSkn = null)
|
|
|
public static function getProductInfo($productId, $goodsId, $uid, $vipLevel = 0, $productSkn = null)
|
|
|
{
|
|
|
$goodsInfo = array();
|
|
|
$statGoodsInfo = array();
|
...
|
...
|
@@ -58,12 +58,12 @@ class ItemModel |
|
|
|
|
|
// 商品标签
|
|
|
$goodsInfo['tags'] = self::getTagsDataByProductInfo($baseInfo);
|
|
|
|
|
|
|
|
|
// 商品促销短语
|
|
|
if (!empty($baseInfo['salesPhrase'])) {
|
|
|
$goodsInfo['saleTip'] = $baseInfo['salesPhrase'];
|
|
|
}
|
|
|
|
|
|
|
|
|
// 商品价格
|
|
|
if (isset($baseInfo['productPriceBo'])) {
|
|
|
$goodsInfo['marketPrice'] = $baseInfo['productPriceBo']['formatMarketPrice'];
|
...
|
...
|
@@ -74,12 +74,12 @@ class ItemModel |
|
|
$goodsInfo['hasOtherPrice'] = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//VIP数据
|
|
|
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel, $uid);
|
|
|
//促销活动banner
|
|
|
$goodsInfo['activity'] = self::getActivityDataByProductBaseInfo($baseInfo);
|
|
|
|
|
|
|
|
|
if (isset($baseInfo['productPriceBo']['yohoCoinNum']) && $baseInfo['productPriceBo']['yohoCoinNum'] !== 0) {
|
|
|
array_push($goodsInfo['activity'],
|
|
|
array('type' => '返YOHO币', 'des' => '每件返 ' . $baseInfo['productPriceBo']['yohoCoinNum'] . '个 YOHO币')
|
...
|
...
|
@@ -93,7 +93,7 @@ class ItemModel |
|
|
unset($goodsInfo['salePrice']);
|
|
|
$goodsInfo['hasOtherPrice'] = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
//商品咨询和评论数据
|
|
|
$consultComment = self::getConsultCommentDataByProductInfo($baseInfo);
|
|
|
// 品牌信息
|
...
|
...
|
@@ -106,13 +106,13 @@ class ItemModel |
|
|
$banner['isCollect'] = $favoriteData['brand'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//sku商品信息
|
|
|
$skuData = self::getSkuDataByProductBaseInfo($baseInfo);
|
|
|
$goodsInfo['img'] = $skuData['defaultImage'];
|
|
|
$goodsInfo['colors'] = $skuData['skuGoods'];
|
|
|
$totalStorageNum = $skuData['totalStorageNum'];
|
|
|
|
|
|
|
|
|
// 是否收藏
|
|
|
$goodsInfo['isCollect'] = $favoriteData['product'];
|
|
|
// 限购商品
|
...
|
...
|
@@ -124,7 +124,7 @@ class ItemModel |
|
|
if (isset($baseInfo['showStatus'])) {
|
|
|
$showStatus = intval($baseInfo['showStatus']);
|
|
|
}
|
|
|
|
|
|
|
|
|
$fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
|
|
|
//潮流尖货状态
|
|
|
$goodsInfo['fashionTopGoods'] = array(
|
...
|
...
|
@@ -142,7 +142,7 @@ class ItemModel |
|
|
$goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
|
|
|
$notForSale = $baseInfo['attribute'] == 2;//非卖品
|
|
|
$virtualGoods = $baseInfo['attribute'] == 3;//虚拟商品
|
...
|
...
|
@@ -177,13 +177,13 @@ class ItemModel |
|
|
if(isset($goodsInfo['tags']['isFew'])) {
|
|
|
unset($goodsInfo['tags']['isFew']);//去掉即将售罄
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//分享相关
|
|
|
$goodsInfo['weixinUrl'] = Helpers::url($_SERVER['REQUEST_URI'], array(),'item');
|
|
|
$goodsInfo['sharedTitle'] = $goodsInfo['name'];
|
|
|
$goodsInfo['shareImg'] = $goodsInfo['img'];
|
|
|
$goodsInfo['shareDesc'] = $baseInfo['phrase'];
|
|
|
|
|
|
|
|
|
//统计需要的商品信息
|
|
|
$statGoodsInfo['uid'] = $uid;
|
|
|
$statGoodsInfo['skn'] = $baseInfo['erpProductId'];
|
...
|
...
|
@@ -201,11 +201,11 @@ class ItemModel |
|
|
$domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']);
|
|
|
if (!empty($domainBrand['type'])) {
|
|
|
switch (intval($domainBrand['type'])) {
|
|
|
case 1:
|
|
|
case 1:
|
|
|
//多品店不显示
|
|
|
$banner = array();
|
|
|
break;
|
|
|
case 2:
|
|
|
case 2:
|
|
|
if (empty($domainBrand['shopId'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -224,22 +224,22 @@ class ItemModel |
|
|
$statGoodsInfo['soldOut'] = intval($soldOut);
|
|
|
return array('goodsInfo'=> $goodsInfo,'consultComment' => $consultComment, 'banner'=> $banner,'statGoodsInfo' => $statGoodsInfo);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 商品尺码信息
|
|
|
*
|
|
|
*
|
|
|
* @param string $productSkn
|
|
|
* @param int $maxSortId
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getSizeInfo($productSkn, $maxSortId)
|
|
|
public static function getSizeInfo($productSkn, $maxSortId)
|
|
|
{
|
|
|
if (is_numeric($productSkn)) {
|
|
|
//并发资源中是否存在数据
|
|
|
$sizeInfo = self::getMultiDataByResourceName('ItemData::sizeInfo');
|
|
|
if(empty($sizeInfo)) {
|
|
|
//获取尺码
|
|
|
$sizeInfo = ItemData::sizeInfo($productSkn);
|
|
|
$sizeInfo = ItemData::sizeInfo($productSkn);
|
|
|
}
|
|
|
if(empty($sizeInfo)) {
|
|
|
return array();
|
...
|
...
|
@@ -265,25 +265,25 @@ class ItemModel |
|
|
//根据最大分类ID获取尺寸属性
|
|
|
$sizeAttr = self::getSizeAttrByMaxSortId($maxSortId, $sizeInfo['sizeInfoBo']);
|
|
|
}
|
|
|
return array('material'=> $material, 'size'=> $size, 'reference'=> $reference,
|
|
|
return array('material'=> $material, 'size'=> $size, 'reference'=> $reference,
|
|
|
'modelCards'=> $modelCards,'details'=> $details,'fittingReport' =>$fittingReport,
|
|
|
'description'=> $description,'sizeTitleJson' => json_encode($sizeAttr));
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
return array();
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取购物车商品信息
|
|
|
*
|
|
|
*
|
|
|
* @param int $productId
|
|
|
* @param int $uid
|
|
|
* @param int $vipLevel
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getCartProductInfo($productId, $uid, $vipLevel)
|
|
|
public static function getCartProductInfo($productId, $uid, $vipLevel)
|
|
|
{
|
|
|
$goodsInfo = array();
|
|
|
$size = array();
|
...
|
...
|
@@ -299,7 +299,7 @@ class ItemModel |
|
|
if (!empty($baseInfo['salesPhrase'])) {
|
|
|
$goodsInfo['saleTip'] = $baseInfo['salesPhrase'];
|
|
|
}
|
|
|
|
|
|
|
|
|
// 商品价格
|
|
|
if (isset($baseInfo['productPriceBo'])) {
|
|
|
$goodsInfo['marketPrice'] = Helpers::transPrice($baseInfo['productPriceBo']['marketPrice']);
|
...
|
...
|
@@ -310,7 +310,7 @@ class ItemModel |
|
|
$goodsInfo['hasOtherPrice'] = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
// 上市期
|
|
|
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
|
|
|
$goodsInfo['arrivalDate'] = $baseInfo['expectArrivalTime'] . '月';
|
...
|
...
|
@@ -318,13 +318,13 @@ class ItemModel |
|
|
unset($goodsInfo['salePrice']);
|
|
|
$goodsInfo['hasOtherPrice'] = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
//VIP数据
|
|
|
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel);
|
|
|
//sku商品信息
|
|
|
$skuData = self::getSkuDataByProductBaseInfo($baseInfo);
|
|
|
$totalStorageNum = $skuData['totalStorageNum'];
|
|
|
|
|
|
|
|
|
$goodsInfo['img'] = $skuData['defaultImage'];
|
|
|
$goodsInfo['colors'] = $skuData['skuGoods'];
|
|
|
$favoriteData = FavoriteData::getUidProductFav($uid, $productId);
|
...
|
...
|
@@ -334,7 +334,7 @@ class ItemModel |
|
|
$size = self::getSizeDataBySizeInfo($sizeInfo);
|
|
|
$goodsInfo['size'] = $size;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 限购商品
|
|
|
if ($baseInfo['isLimitBuy'] === 'Y') {
|
|
|
// 是否开售
|
...
|
...
|
@@ -344,7 +344,7 @@ class ItemModel |
|
|
if (isset($baseInfo['showStatus'])) {
|
|
|
$showStatus = intval($baseInfo['showStatus']);
|
|
|
}
|
|
|
|
|
|
|
|
|
$fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
|
|
|
//潮流尖货状态
|
|
|
$goodsInfo['fashionTopGoods'] = array(
|
...
|
...
|
@@ -362,7 +362,7 @@ class ItemModel |
|
|
$goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//商品状态
|
|
|
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
|
|
|
$notForSale = $baseInfo['attribute'] == 2;//非卖品
|
...
|
...
|
@@ -392,18 +392,18 @@ class ItemModel |
|
|
unset($goodsInfo['salePrice']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
return $goodsInfo;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取分类导航列表
|
|
|
*
|
|
|
*
|
|
|
* @param string $smallSortId
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getSortNav($smallSortId)
|
|
|
public static function getSortNav($smallSortId)
|
|
|
{
|
|
|
$key = WebCacheConfig::KEY_WEB_ITEM_SORT_DATA.'_'.$smallSortId;
|
|
|
$navs = Cache::get($key);
|
...
|
...
|
@@ -427,17 +427,17 @@ class ItemModel |
|
|
}
|
|
|
return $navs;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取咨询列表
|
|
|
*
|
|
|
*
|
|
|
* @param int $uid
|
|
|
* @param int $productId
|
|
|
* @param int $pageNum
|
|
|
* @param int $pageSize
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getConsults($uid, $productId, $pageNum = 1, $pageSize = 30)
|
|
|
public static function getConsults($uid, $productId, $pageNum = 1, $pageSize = 30)
|
|
|
{
|
|
|
$result = array();
|
|
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
...
|
...
|
@@ -461,16 +461,16 @@ class ItemModel |
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取评论
|
|
|
*
|
|
|
*
|
|
|
* @param int $productId
|
|
|
* @param int $pageNum
|
|
|
* @param int $pageSize
|
|
|
* @return array
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getComments($productId, $pageNum = 1, $pageSize = 10)
|
|
|
public static function getComments($productId, $pageNum = 1, $pageSize = 10)
|
|
|
{
|
|
|
$result = array();
|
|
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
...
|
...
|
@@ -498,10 +498,10 @@ class ItemModel |
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品活动banner
|
|
|
*
|
|
|
*
|
|
|
* @param int $productId
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -519,14 +519,14 @@ class ItemModel |
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品热区
|
|
|
*
|
|
|
*
|
|
|
* @param string $productId
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getProductHotArea($productId)
|
|
|
public static function getProductHotArea($productId)
|
|
|
{
|
|
|
$result = array();
|
|
|
$data = ItemData::getProductHotArea($productId);
|
...
|
...
|
@@ -555,6 +555,7 @@ class ItemModel |
|
|
'href' => Helpers::getUrlBySkc($goods['goodsImagesList'][0]['productId'],
|
|
|
$goods['goodsImagesList'][0]['goodsId'], $val['product']['cnAlphabet']),
|
|
|
);
|
|
|
$point['href'] = $point['product']['href'];
|
|
|
}
|
|
|
}
|
|
|
if(!empty($point)) {
|
...
|
...
|
@@ -562,17 +563,17 @@ class ItemModel |
|
|
}
|
|
|
}
|
|
|
if(!empty($temp)) {
|
|
|
$result[] = $temp;
|
|
|
$result[] = $temp;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品模特卡
|
|
|
*
|
|
|
*
|
|
|
* @param string $productId
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -594,7 +595,7 @@ class ItemModel |
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 添加咨询
|
|
|
*
|
...
|
...
|
@@ -607,10 +608,10 @@ class ItemModel |
|
|
{
|
|
|
return ItemData::addConsult($uid, $productId, $content);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品的舒适度
|
|
|
*
|
|
|
*
|
|
|
* @param int $productId
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -646,7 +647,7 @@ class ItemModel |
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品的喜欢
|
|
|
* @param int $uid
|
...
|
...
|
@@ -672,10 +673,10 @@ class ItemModel |
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据商品信息设置并发请求
|
|
|
*
|
|
|
*
|
|
|
* @param array $productInfo
|
|
|
*/
|
|
|
private static function setMultiResourceByProductBaseInfo(&$baseInfo)
|
...
|
...
|
@@ -698,10 +699,10 @@ class ItemModel |
|
|
}
|
|
|
self::$multiResources = Yohobuy::getMulti($multiResourcesUrl, array(), false, 5, true);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据资源名称获取并发数据
|
|
|
*
|
|
|
*
|
|
|
* @param string $resourceName
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -713,13 +714,13 @@ class ItemModel |
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据最大分类ID获取尺寸属性
|
|
|
*
|
|
|
*
|
|
|
* @param string $maxSortId
|
|
|
* @param array $sizeList
|
|
|
* @return array
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getSizeAttrByMaxSortId($maxSortId, array $sizeList)
|
|
|
{
|
...
|
...
|
@@ -741,7 +742,7 @@ class ItemModel |
|
|
foreach($sizeList['sizeAttributeBos'] as $size) {
|
|
|
$attributeNames[$size['id']] = $size['attributeName'];
|
|
|
}
|
|
|
|
|
|
|
|
|
foreach($sizeList['sizeBoList'] as $size) {
|
|
|
$sizeValues = array();
|
|
|
foreach($size['sortAttributes'] as $sort) {
|
...
|
...
|
@@ -758,14 +759,14 @@ class ItemModel |
|
|
}
|
|
|
return $sizeInfos;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取尺寸信息
|
|
|
*
|
|
|
*
|
|
|
* @param array $sizeInfo
|
|
|
* @return array
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getSizeDataBySizeInfo(array &$sizeInfo)
|
|
|
private static function getSizeDataBySizeInfo(array &$sizeInfo)
|
|
|
{
|
|
|
$size = array();
|
|
|
// 尺码信息
|
...
|
...
|
@@ -786,7 +787,7 @@ class ItemModel |
|
|
// 判断是否显示参考尺码
|
|
|
$showReference = ($boyReference && !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['boyReferSize'])) ||
|
|
|
($girlReference && !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['girlReferSize']) );
|
|
|
|
|
|
|
|
|
if (!empty($sizeInfo['sizeInfoBo']['sizeAttributeBos'])) {
|
|
|
//尺码信息头部
|
|
|
$size['thead'] = array(0 => array('name' => '吊牌尺码', 'id' => ''));
|
...
|
...
|
@@ -809,7 +810,7 @@ class ItemModel |
|
|
} else {
|
|
|
if(isset($size['thead'][1]) && $showReference) {
|
|
|
$size['thead'][1] = array();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//其他尺码信息
|
|
|
foreach ($value['sortAttributes'] as $attr) {
|
...
|
...
|
@@ -825,14 +826,14 @@ class ItemModel |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
// 测量方式
|
|
|
if (!empty($sizeInfo['sizeImage'])) {
|
|
|
$size['sizeImg'] = $sizeInfo['sizeImage'];
|
|
|
}
|
|
|
return $size;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 使sizeBoList id以 sizeAttributeBos id顺序一样
|
|
|
* @param type array $sizeInfoBo
|
...
|
...
|
@@ -843,7 +844,7 @@ class ItemModel |
|
|
if (empty($sizeInfoBo['sizeBoList']) || empty($sizeInfoBo['sizeAttributeBos'])) {
|
|
|
return array();
|
|
|
}
|
|
|
|
|
|
|
|
|
foreach ($sizeInfoBo['sizeBoList'] as $sizek => $sizeBoList) {
|
|
|
$sortArr = array();
|
|
|
foreach ($sizeBoList['sortAttributes'] as $sortAttributes) {
|
...
|
...
|
@@ -851,7 +852,7 @@ class ItemModel |
|
|
}
|
|
|
$sizeInfoBo['sizeBoList'][$sizek]['sortAttributes'] = $sortArr;
|
|
|
}
|
|
|
|
|
|
|
|
|
foreach ($sizeInfoBo['sizeBoList'] as $sizek => $sizeBoList) {
|
|
|
$sortArr = array();
|
|
|
foreach ($sizeInfoBo['sizeAttributeBos'] as $val) {
|
...
|
...
|
@@ -859,17 +860,17 @@ class ItemModel |
|
|
}
|
|
|
$sizeInfoBo['sizeBoList'][$sizek]['sortAttributes'] = $sortArr;
|
|
|
}
|
|
|
|
|
|
|
|
|
return $sizeInfoBo;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取模特数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $sizeInfo
|
|
|
* @return array
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getReferenceDataBySizeInfo(array &$sizeInfo)
|
|
|
private static function getReferenceDataBySizeInfo(array &$sizeInfo)
|
|
|
{
|
|
|
$reference = array();
|
|
|
if (!empty($sizeInfo['modelBos'])) {
|
...
|
...
|
@@ -898,14 +899,14 @@ class ItemModel |
|
|
}
|
|
|
return $reference;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取洗涤材质
|
|
|
*
|
|
|
*
|
|
|
* @param array $sizeInfo
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getMaterialDataBySizeInfo(array &$sizeInfo)
|
|
|
private static function getMaterialDataBySizeInfo(array &$sizeInfo)
|
|
|
{
|
|
|
$material = array();
|
|
|
//洗涤提示
|
...
|
...
|
@@ -915,7 +916,7 @@ class ItemModel |
|
|
$material['wash'][] = array('name' => $value['caption'],'img' => $value['img']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (!empty($sizeInfo['productMaterialList'])) {
|
|
|
//商品材质[洗涤说明]
|
|
|
$material['materialDetail'] = array();
|
...
|
...
|
@@ -930,14 +931,14 @@ class ItemModel |
|
|
}
|
|
|
return $material;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取描述数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $sizeInfo
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getDescriptionDataBySizeInfo(array &$sizeInfo)
|
|
|
private static function getDescriptionDataBySizeInfo(array &$sizeInfo)
|
|
|
{
|
|
|
$description = array();
|
|
|
// 商品信息
|
...
|
...
|
@@ -963,14 +964,14 @@ class ItemModel |
|
|
}
|
|
|
return $description;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品详情页介绍
|
|
|
*
|
|
|
*
|
|
|
* @param array $sizeInfo
|
|
|
* @return string
|
|
|
*/
|
|
|
private static function getDetailDataBySizeInfo(array &$sizeInfo)
|
|
|
private static function getDetailDataBySizeInfo(array &$sizeInfo)
|
|
|
{
|
|
|
$details = '';
|
|
|
// 详情配图
|
...
|
...
|
@@ -987,14 +988,14 @@ class ItemModel |
|
|
}
|
|
|
return $details;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取sku商品数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $baseInfo
|
|
|
* @return array
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getSkuDataByProductBaseInfo(array &$baseInfo)
|
|
|
private static function getSkuDataByProductBaseInfo(array &$baseInfo)
|
|
|
{
|
|
|
$totalStorageNum = 0;
|
|
|
$skuGoods = array();//sku商品
|
...
|
...
|
@@ -1003,8 +1004,8 @@ class ItemModel |
|
|
if (!empty($baseInfo['goodsList'])) {
|
|
|
$goodsGroup = array();
|
|
|
foreach ($baseInfo['goodsList'] as $pos => $value) {
|
|
|
|
|
|
// 如果status为0,即skc下架时就跳过该商品$value['status'] === 0
|
|
|
|
|
|
// 如果status为0,即skc下架时就跳过该商品$value['status'] === 0
|
|
|
if (empty($value['colorImage']) ) {
|
|
|
continue;
|
|
|
}
|
...
|
...
|
@@ -1020,7 +1021,7 @@ class ItemModel |
|
|
'thumbs' => array(),
|
|
|
'size' => array(),
|
|
|
);
|
|
|
|
|
|
|
|
|
foreach ($value['goodsImagesList'] as $goods) {
|
|
|
if(!empty($goods['imageUrl'])) {
|
|
|
$goodsGroup['thumbs'][] = array(
|
...
|
...
|
@@ -1029,17 +1030,17 @@ class ItemModel |
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//缩略图空,不显示
|
|
|
if(empty($goodsGroup['thumbs'])) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
|
|
|
//默认第一张图片
|
|
|
if($pos == 0) {
|
|
|
$defaultImage = Images::getImageUrl($value['colorImage'], 420, 560);
|
|
|
}
|
|
|
|
|
|
|
|
|
//商品的尺码列表
|
|
|
foreach ($value['goodsSizeBoList'] as $size) {
|
|
|
if($baseInfo['attribute'] == 3 ) { //虚拟商品,增加为一件
|
...
|
...
|
@@ -1057,7 +1058,7 @@ class ItemModel |
|
|
);
|
|
|
//单个sku商品的总数
|
|
|
$goodsGroup['total'] += intval($size['goodsSizeStorageNum']);
|
|
|
|
|
|
|
|
|
if($goodsGroup['total']> 0 && !$chooseSkuFlag) { //默认选中该sku商品
|
|
|
$goodsGroup['focus'] = true;
|
|
|
$chooseSkuFlag = true;//选中sku商品
|
...
|
...
|
@@ -1074,14 +1075,14 @@ class ItemModel |
|
|
return array('skuGoods' => $skuGoods,'totalStorageNum' => $totalStorageNum,
|
|
|
'defaultImage' => $defaultImage);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取品牌数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $baseInfo
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getBrandDataByProductBaseInfo(array &$baseInfo)
|
|
|
private static function getBrandDataByProductBaseInfo(array &$baseInfo)
|
|
|
{
|
|
|
if(empty($baseInfo['brand'])) {
|
|
|
return array();
|
...
|
...
|
@@ -1102,12 +1103,12 @@ class ItemModel |
|
|
if(!empty($bannerInfo['bannerUrl'])) {
|
|
|
$bgImg = Images::getForceSourceUrl($bannerInfo['bannerUrl']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//banner的logo
|
|
|
if(!empty($bannerInfo['logo']))
|
|
|
if(!empty($bannerInfo['logo']))
|
|
|
{
|
|
|
$logo = Images::getForceSourceUrl($bannerInfo['logo']);
|
|
|
}
|
|
|
}
|
|
|
$homeUrl = 'javascript:void(0)';
|
|
|
if(!empty($baseInfo['brand']['brandDomain'])){
|
|
|
$homeUrl = Helpers::url('', array(), $baseInfo['brand']['brandDomain']);
|
...
|
...
|
@@ -1125,16 +1126,16 @@ class ItemModel |
|
|
'isCollect'=> false
|
|
|
);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取vip数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $baseInfo
|
|
|
* @param int $vipLevel
|
|
|
* @param int $uid
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function getVipDataByProductBaseInfo(array &$baseInfo, $vipLevel = 0, $uid = 0)
|
|
|
private static function getVipDataByProductBaseInfo(array &$baseInfo, $vipLevel = 0, $uid = 0)
|
|
|
{
|
|
|
$vipData = array();
|
|
|
if (!empty($baseInfo['productPriceBo']['vipPrices'])) {
|
...
|
...
|
@@ -1162,10 +1163,10 @@ class ItemModel |
|
|
}
|
|
|
return $vipData;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取活动数据(促销相关活动)
|
|
|
*
|
|
|
*
|
|
|
* @param array $baseInfo
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -1189,10 +1190,10 @@ class ItemModel |
|
|
}
|
|
|
return $activity;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取标签相关数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $baseInfo
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -1231,12 +1232,12 @@ class ItemModel |
|
|
}
|
|
|
return $tags;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取模特试穿
|
|
|
*
|
|
|
*
|
|
|
* @param string $productSkn
|
|
|
* @return array
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getProductModelTry($productSkn)
|
|
|
{
|
...
|
...
|
@@ -1265,11 +1266,11 @@ class ItemModel |
|
|
}
|
|
|
return $modelTry;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 处理限购商品的有关按钮状态(或取现购买以及底部商品购买按钮)
|
|
|
*
|
|
|
* @param int $uid
|
|
|
* @param int $uid
|
|
|
* @param int $showStatus 限购商品的关联状态
|
|
|
* @param boolean $isBeginSale 限购商品是否已开售
|
|
|
*/
|
...
|
...
|
@@ -1282,8 +1283,8 @@ class ItemModel |
|
|
//openSoon//即将开售
|
|
|
//dis //失效
|
|
|
//buyNow //是否立即购买
|
|
|
$result = array('getLimitedCode' => false, 'hasLimitedCode' => false,
|
|
|
'limitedCodeSoldOut' => false, 'openSoon' => false, 'dis' => false,
|
|
|
$result = array('getLimitedCode' => false, 'hasLimitedCode' => false,
|
|
|
'limitedCodeSoldOut' => false, 'openSoon' => false, 'dis' => false,
|
|
|
'buyNow' => false, 'soldOut'=> false, 'getLimitedCodeDis'=> false);
|
|
|
// 显示获取限购码按钮
|
|
|
$result['getLimitedCode'] = true;
|
...
|
...
|
@@ -1321,14 +1322,14 @@ class ItemModel |
|
|
$result['hasLimitedCode'] = true;
|
|
|
$result['limitedCodeSoldOut'] = true;
|
|
|
$result['getLimitedCode'] = false;
|
|
|
|
|
|
|
|
|
break;
|
|
|
case 6: // 开售前,即将开售(用户已领取限购码)
|
|
|
$result['openSoon'] = true;
|
|
|
$result['hasLimitedCode'] = true;
|
|
|
if(!empty($uid)) {//限购码失效
|
|
|
$result['getLimitedCodeDis'] = true;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case 7: // 开售后,用户已经用获得的限购码购买过商品
|
|
|
$result['buyNow'] = true;
|
...
|
...
|
@@ -1341,12 +1342,12 @@ class ItemModel |
|
|
break;
|
|
|
}
|
|
|
return $result;
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取商品咨询和评论数据
|
|
|
*
|
|
|
*
|
|
|
* @param array $baseInfo
|
|
|
* @return array
|
|
|
*/
|
...
|
...
|
@@ -1368,5 +1369,5 @@ class ItemModel |
|
|
}
|
|
|
return $consultComment;
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
|
|
|
|
|
} |
...
|
...
|
|