|
@@ -18,10 +18,10 @@ class ItemModel |
|
@@ -18,10 +18,10 @@ class ItemModel |
18
|
* @var array
|
18
|
* @var array
|
19
|
*/
|
19
|
*/
|
20
|
private static $multiResources = array();
|
20
|
private static $multiResources = array();
|
21
|
-
|
21
|
+
|
22
|
/**
|
22
|
/**
|
23
|
* 获取商品信息
|
23
|
* 获取商品信息
|
24
|
- *
|
24
|
+ *
|
25
|
* @param string $productId
|
25
|
* @param string $productId
|
26
|
* @param string $goodsId
|
26
|
* @param string $goodsId
|
27
|
* @param string $uid
|
27
|
* @param string $uid
|
|
@@ -29,7 +29,7 @@ class ItemModel |
|
@@ -29,7 +29,7 @@ class ItemModel |
29
|
* @param string $productSkn
|
29
|
* @param string $productSkn
|
30
|
* @return array
|
30
|
* @return array
|
31
|
*/
|
31
|
*/
|
32
|
- public static function getProductInfo($productId, $goodsId, $uid, $vipLevel = 0, $productSkn = null)
|
32
|
+ public static function getProductInfo($productId, $goodsId, $uid, $vipLevel = 0, $productSkn = null)
|
33
|
{
|
33
|
{
|
34
|
$goodsInfo = array();
|
34
|
$goodsInfo = array();
|
35
|
$statGoodsInfo = array();
|
35
|
$statGoodsInfo = array();
|
|
@@ -58,7 +58,7 @@ class ItemModel |
|
@@ -58,7 +58,7 @@ class ItemModel |
58
|
|
58
|
|
59
|
// 商品标签
|
59
|
// 商品标签
|
60
|
$goodsInfo['tags'] = self::getTagsDataByProductInfo($baseInfo);
|
60
|
$goodsInfo['tags'] = self::getTagsDataByProductInfo($baseInfo);
|
61
|
-
|
61
|
+
|
62
|
// 商品促销短语
|
62
|
// 商品促销短语
|
63
|
if (!empty($baseInfo['salesPhrase'])) {
|
63
|
if (!empty($baseInfo['salesPhrase'])) {
|
64
|
$goodsInfo['saleTip'] = $baseInfo['salesPhrase'];
|
64
|
$goodsInfo['saleTip'] = $baseInfo['salesPhrase'];
|
|
@@ -79,12 +79,12 @@ class ItemModel |
|
@@ -79,12 +79,12 @@ class ItemModel |
79
|
$goodsInfo['hasOtherPrice'] = false;
|
79
|
$goodsInfo['hasOtherPrice'] = false;
|
80
|
}
|
80
|
}
|
81
|
}
|
81
|
}
|
82
|
-
|
82
|
+
|
83
|
//VIP数据
|
83
|
//VIP数据
|
84
|
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel, $uid);
|
84
|
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel, $uid);
|
85
|
//促销活动banner
|
85
|
//促销活动banner
|
86
|
$goodsInfo['activity'] = self::getActivityDataByProductBaseInfo($baseInfo);
|
86
|
$goodsInfo['activity'] = self::getActivityDataByProductBaseInfo($baseInfo);
|
87
|
-
|
87
|
+
|
88
|
if (isset($baseInfo['productPriceBo']['yohoCoinNum']) && $baseInfo['productPriceBo']['yohoCoinNum'] !== 0) {
|
88
|
if (isset($baseInfo['productPriceBo']['yohoCoinNum']) && $baseInfo['productPriceBo']['yohoCoinNum'] !== 0) {
|
89
|
array_push($goodsInfo['activity'],
|
89
|
array_push($goodsInfo['activity'],
|
90
|
array('type' => '返YOHO币', 'des' => '每件返 ' . $baseInfo['productPriceBo']['yohoCoinNum'] . '个 YOHO币')
|
90
|
array('type' => '返YOHO币', 'des' => '每件返 ' . $baseInfo['productPriceBo']['yohoCoinNum'] . '个 YOHO币')
|
|
@@ -98,7 +98,7 @@ class ItemModel |
|
@@ -98,7 +98,7 @@ class ItemModel |
98
|
unset($goodsInfo['salePrice']);
|
98
|
unset($goodsInfo['salePrice']);
|
99
|
$goodsInfo['hasOtherPrice'] = false;
|
99
|
$goodsInfo['hasOtherPrice'] = false;
|
100
|
}
|
100
|
}
|
101
|
-
|
101
|
+
|
102
|
//商品咨询和评论数据
|
102
|
//商品咨询和评论数据
|
103
|
$consultComment = self::getConsultCommentDataByProductInfo($baseInfo);
|
103
|
$consultComment = self::getConsultCommentDataByProductInfo($baseInfo);
|
104
|
// 品牌信息
|
104
|
// 品牌信息
|
|
@@ -111,13 +111,13 @@ class ItemModel |
|
@@ -111,13 +111,13 @@ class ItemModel |
111
|
$banner['isCollect'] = $favoriteData['brand'];
|
111
|
$banner['isCollect'] = $favoriteData['brand'];
|
112
|
}
|
112
|
}
|
113
|
}
|
113
|
}
|
114
|
-
|
114
|
+
|
115
|
//sku商品信息
|
115
|
//sku商品信息
|
116
|
$skuData = self::getSkuDataByProductBaseInfo($baseInfo);
|
116
|
$skuData = self::getSkuDataByProductBaseInfo($baseInfo);
|
117
|
$goodsInfo['img'] = $skuData['defaultImage'];
|
117
|
$goodsInfo['img'] = $skuData['defaultImage'];
|
118
|
$goodsInfo['colors'] = $skuData['skuGoods'];
|
118
|
$goodsInfo['colors'] = $skuData['skuGoods'];
|
119
|
$totalStorageNum = $skuData['totalStorageNum'];
|
119
|
$totalStorageNum = $skuData['totalStorageNum'];
|
120
|
-
|
120
|
+
|
121
|
// 是否收藏
|
121
|
// 是否收藏
|
122
|
$goodsInfo['isCollect'] = $favoriteData['product'];
|
122
|
$goodsInfo['isCollect'] = $favoriteData['product'];
|
123
|
// 限购商品
|
123
|
// 限购商品
|
|
@@ -129,7 +129,7 @@ class ItemModel |
|
@@ -129,7 +129,7 @@ class ItemModel |
129
|
if (isset($baseInfo['showStatus'])) {
|
129
|
if (isset($baseInfo['showStatus'])) {
|
130
|
$showStatus = intval($baseInfo['showStatus']);
|
130
|
$showStatus = intval($baseInfo['showStatus']);
|
131
|
}
|
131
|
}
|
132
|
-
|
132
|
+
|
133
|
$fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
|
133
|
$fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
|
134
|
//潮流尖货状态
|
134
|
//潮流尖货状态
|
135
|
$goodsInfo['fashionTopGoods'] = array(
|
135
|
$goodsInfo['fashionTopGoods'] = array(
|
|
@@ -147,7 +147,7 @@ class ItemModel |
|
@@ -147,7 +147,7 @@ class ItemModel |
147
|
$goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
|
147
|
$goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
|
148
|
}
|
148
|
}
|
149
|
}
|
149
|
}
|
150
|
-
|
150
|
+
|
151
|
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
|
151
|
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
|
152
|
$notForSale = $baseInfo['attribute'] == 2;//非卖品
|
152
|
$notForSale = $baseInfo['attribute'] == 2;//非卖品
|
153
|
$virtualGoods = $baseInfo['attribute'] == 3;//虚拟商品
|
153
|
$virtualGoods = $baseInfo['attribute'] == 3;//虚拟商品
|
|
@@ -182,13 +182,13 @@ class ItemModel |
|
@@ -182,13 +182,13 @@ class ItemModel |
182
|
if(isset($goodsInfo['tags']['isFew'])) {
|
182
|
if(isset($goodsInfo['tags']['isFew'])) {
|
183
|
unset($goodsInfo['tags']['isFew']);//去掉即将售罄
|
183
|
unset($goodsInfo['tags']['isFew']);//去掉即将售罄
|
184
|
}
|
184
|
}
|
185
|
- }
|
185
|
+ }
|
186
|
//分享相关
|
186
|
//分享相关
|
187
|
$goodsInfo['weixinUrl'] = Helpers::url($_SERVER['REQUEST_URI'], array(),'item');
|
187
|
$goodsInfo['weixinUrl'] = Helpers::url($_SERVER['REQUEST_URI'], array(),'item');
|
188
|
$goodsInfo['sharedTitle'] = $goodsInfo['name'];
|
188
|
$goodsInfo['sharedTitle'] = $goodsInfo['name'];
|
189
|
$goodsInfo['shareImg'] = $goodsInfo['img'];
|
189
|
$goodsInfo['shareImg'] = $goodsInfo['img'];
|
190
|
$goodsInfo['shareDesc'] = $baseInfo['phrase'];
|
190
|
$goodsInfo['shareDesc'] = $baseInfo['phrase'];
|
191
|
-
|
191
|
+
|
192
|
//统计需要的商品信息
|
192
|
//统计需要的商品信息
|
193
|
$statGoodsInfo['uid'] = $uid;
|
193
|
$statGoodsInfo['uid'] = $uid;
|
194
|
$statGoodsInfo['skn'] = $baseInfo['erpProductId'];
|
194
|
$statGoodsInfo['skn'] = $baseInfo['erpProductId'];
|
|
@@ -206,11 +206,11 @@ class ItemModel |
|
@@ -206,11 +206,11 @@ class ItemModel |
206
|
$domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']);
|
206
|
$domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']);
|
207
|
if (!empty($domainBrand['type'])) {
|
207
|
if (!empty($domainBrand['type'])) {
|
208
|
switch (intval($domainBrand['type'])) {
|
208
|
switch (intval($domainBrand['type'])) {
|
209
|
- case 1:
|
209
|
+ case 1:
|
210
|
//多品店不显示
|
210
|
//多品店不显示
|
211
|
$banner = array();
|
211
|
$banner = array();
|
212
|
break;
|
212
|
break;
|
213
|
- case 2:
|
213
|
+ case 2:
|
214
|
if (empty($domainBrand['shopId'])) {
|
214
|
if (empty($domainBrand['shopId'])) {
|
215
|
break;
|
215
|
break;
|
216
|
}
|
216
|
}
|
|
@@ -229,22 +229,22 @@ class ItemModel |
|
@@ -229,22 +229,22 @@ class ItemModel |
229
|
$statGoodsInfo['soldOut'] = intval($soldOut);
|
229
|
$statGoodsInfo['soldOut'] = intval($soldOut);
|
230
|
return array('goodsInfo'=> $goodsInfo,'consultComment' => $consultComment, 'banner'=> $banner,'statGoodsInfo' => $statGoodsInfo);
|
230
|
return array('goodsInfo'=> $goodsInfo,'consultComment' => $consultComment, 'banner'=> $banner,'statGoodsInfo' => $statGoodsInfo);
|
231
|
}
|
231
|
}
|
232
|
-
|
232
|
+
|
233
|
/**
|
233
|
/**
|
234
|
* 商品尺码信息
|
234
|
* 商品尺码信息
|
235
|
- *
|
235
|
+ *
|
236
|
* @param string $productSkn
|
236
|
* @param string $productSkn
|
237
|
* @param int $maxSortId
|
237
|
* @param int $maxSortId
|
238
|
* @return array
|
238
|
* @return array
|
239
|
*/
|
239
|
*/
|
240
|
- public static function getSizeInfo($productSkn, $maxSortId)
|
240
|
+ public static function getSizeInfo($productSkn, $maxSortId)
|
241
|
{
|
241
|
{
|
242
|
if (is_numeric($productSkn)) {
|
242
|
if (is_numeric($productSkn)) {
|
243
|
//并发资源中是否存在数据
|
243
|
//并发资源中是否存在数据
|
244
|
$sizeInfo = self::getMultiDataByResourceName('ItemData::sizeInfo');
|
244
|
$sizeInfo = self::getMultiDataByResourceName('ItemData::sizeInfo');
|
245
|
if(empty($sizeInfo)) {
|
245
|
if(empty($sizeInfo)) {
|
246
|
//获取尺码
|
246
|
//获取尺码
|
247
|
- $sizeInfo = ItemData::sizeInfo($productSkn);
|
247
|
+ $sizeInfo = ItemData::sizeInfo($productSkn);
|
248
|
}
|
248
|
}
|
249
|
if(empty($sizeInfo)) {
|
249
|
if(empty($sizeInfo)) {
|
250
|
return array();
|
250
|
return array();
|
|
@@ -270,25 +270,25 @@ class ItemModel |
|
@@ -270,25 +270,25 @@ class ItemModel |
270
|
//根据最大分类ID获取尺寸属性
|
270
|
//根据最大分类ID获取尺寸属性
|
271
|
$sizeAttr = self::getSizeAttrByMaxSortId($maxSortId, $sizeInfo['sizeInfoBo']);
|
271
|
$sizeAttr = self::getSizeAttrByMaxSortId($maxSortId, $sizeInfo['sizeInfoBo']);
|
272
|
}
|
272
|
}
|
273
|
- return array('material'=> $material, 'size'=> $size, 'reference'=> $reference,
|
273
|
+ return array('material'=> $material, 'size'=> $size, 'reference'=> $reference,
|
274
|
'modelCards'=> $modelCards,'details'=> $details,'fittingReport' =>$fittingReport,
|
274
|
'modelCards'=> $modelCards,'details'=> $details,'fittingReport' =>$fittingReport,
|
275
|
'description'=> $description,'sizeTitleJson' => json_encode($sizeAttr));
|
275
|
'description'=> $description,'sizeTitleJson' => json_encode($sizeAttr));
|
276
|
- }
|
276
|
+ }
|
277
|
else {
|
277
|
else {
|
278
|
return array();
|
278
|
return array();
|
279
|
}
|
279
|
}
|
280
|
-
|
280
|
+
|
281
|
}
|
281
|
}
|
282
|
-
|
282
|
+
|
283
|
/**
|
283
|
/**
|
284
|
* 获取购物车商品信息
|
284
|
* 获取购物车商品信息
|
285
|
- *
|
285
|
+ *
|
286
|
* @param int $productId
|
286
|
* @param int $productId
|
287
|
* @param int $uid
|
287
|
* @param int $uid
|
288
|
* @param int $vipLevel
|
288
|
* @param int $vipLevel
|
289
|
* @return array
|
289
|
* @return array
|
290
|
*/
|
290
|
*/
|
291
|
- public static function getCartProductInfo($productId, $uid, $vipLevel)
|
291
|
+ public static function getCartProductInfo($productId, $uid, $vipLevel)
|
292
|
{
|
292
|
{
|
293
|
$goodsInfo = array();
|
293
|
$goodsInfo = array();
|
294
|
$size = array();
|
294
|
$size = array();
|
|
@@ -304,7 +304,7 @@ class ItemModel |
|
@@ -304,7 +304,7 @@ class ItemModel |
304
|
if (!empty($baseInfo['salesPhrase'])) {
|
304
|
if (!empty($baseInfo['salesPhrase'])) {
|
305
|
$goodsInfo['saleTip'] = $baseInfo['salesPhrase'];
|
305
|
$goodsInfo['saleTip'] = $baseInfo['salesPhrase'];
|
306
|
}
|
306
|
}
|
307
|
-
|
307
|
+
|
308
|
// 商品价格
|
308
|
// 商品价格
|
309
|
if (isset($baseInfo['productPriceBo'])) {
|
309
|
if (isset($baseInfo['productPriceBo'])) {
|
310
|
$goodsInfo['marketPrice'] = Helpers::transPrice($baseInfo['productPriceBo']['marketPrice']);
|
310
|
$goodsInfo['marketPrice'] = Helpers::transPrice($baseInfo['productPriceBo']['marketPrice']);
|
|
@@ -315,7 +315,7 @@ class ItemModel |
|
@@ -315,7 +315,7 @@ class ItemModel |
315
|
$goodsInfo['hasOtherPrice'] = false;
|
315
|
$goodsInfo['hasOtherPrice'] = false;
|
316
|
}
|
316
|
}
|
317
|
}
|
317
|
}
|
318
|
-
|
318
|
+
|
319
|
// 上市期
|
319
|
// 上市期
|
320
|
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
|
320
|
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
|
321
|
$goodsInfo['arrivalDate'] = $baseInfo['expectArrivalTime'] . '月';
|
321
|
$goodsInfo['arrivalDate'] = $baseInfo['expectArrivalTime'] . '月';
|
|
@@ -323,13 +323,13 @@ class ItemModel |
|
@@ -323,13 +323,13 @@ class ItemModel |
323
|
unset($goodsInfo['salePrice']);
|
323
|
unset($goodsInfo['salePrice']);
|
324
|
$goodsInfo['hasOtherPrice'] = false;
|
324
|
$goodsInfo['hasOtherPrice'] = false;
|
325
|
}
|
325
|
}
|
326
|
-
|
326
|
+
|
327
|
//VIP数据
|
327
|
//VIP数据
|
328
|
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel);
|
328
|
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel);
|
329
|
//sku商品信息
|
329
|
//sku商品信息
|
330
|
$skuData = self::getSkuDataByProductBaseInfo($baseInfo);
|
330
|
$skuData = self::getSkuDataByProductBaseInfo($baseInfo);
|
331
|
$totalStorageNum = $skuData['totalStorageNum'];
|
331
|
$totalStorageNum = $skuData['totalStorageNum'];
|
332
|
-
|
332
|
+
|
333
|
$goodsInfo['img'] = $skuData['defaultImage'];
|
333
|
$goodsInfo['img'] = $skuData['defaultImage'];
|
334
|
$goodsInfo['colors'] = $skuData['skuGoods'];
|
334
|
$goodsInfo['colors'] = $skuData['skuGoods'];
|
335
|
$favoriteData = FavoriteData::getUidProductFav($uid, $productId);
|
335
|
$favoriteData = FavoriteData::getUidProductFav($uid, $productId);
|
|
@@ -339,7 +339,7 @@ class ItemModel |
|
@@ -339,7 +339,7 @@ class ItemModel |
339
|
$size = self::getSizeDataBySizeInfo($sizeInfo);
|
339
|
$size = self::getSizeDataBySizeInfo($sizeInfo);
|
340
|
$goodsInfo['size'] = $size;
|
340
|
$goodsInfo['size'] = $size;
|
341
|
}
|
341
|
}
|
342
|
-
|
342
|
+
|
343
|
// 限购商品
|
343
|
// 限购商品
|
344
|
if ($baseInfo['isLimitBuy'] === 'Y') {
|
344
|
if ($baseInfo['isLimitBuy'] === 'Y') {
|
345
|
// 是否开售
|
345
|
// 是否开售
|
|
@@ -349,7 +349,7 @@ class ItemModel |
|
@@ -349,7 +349,7 @@ class ItemModel |
349
|
if (isset($baseInfo['showStatus'])) {
|
349
|
if (isset($baseInfo['showStatus'])) {
|
350
|
$showStatus = intval($baseInfo['showStatus']);
|
350
|
$showStatus = intval($baseInfo['showStatus']);
|
351
|
}
|
351
|
}
|
352
|
-
|
352
|
+
|
353
|
$fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
|
353
|
$fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
|
354
|
//潮流尖货状态
|
354
|
//潮流尖货状态
|
355
|
$goodsInfo['fashionTopGoods'] = array(
|
355
|
$goodsInfo['fashionTopGoods'] = array(
|
|
@@ -367,7 +367,7 @@ class ItemModel |
|
@@ -367,7 +367,7 @@ class ItemModel |
367
|
$goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
|
367
|
$goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
|
368
|
}
|
368
|
}
|
369
|
}
|
369
|
}
|
370
|
-
|
370
|
+
|
371
|
//商品状态
|
371
|
//商品状态
|
372
|
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
|
372
|
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
|
373
|
$notForSale = $baseInfo['attribute'] == 2;//非卖品
|
373
|
$notForSale = $baseInfo['attribute'] == 2;//非卖品
|
|
@@ -397,18 +397,18 @@ class ItemModel |
|
@@ -397,18 +397,18 @@ class ItemModel |
397
|
unset($goodsInfo['salePrice']);
|
397
|
unset($goodsInfo['salePrice']);
|
398
|
}
|
398
|
}
|
399
|
}
|
399
|
}
|
400
|
-
|
400
|
+
|
401
|
}
|
401
|
}
|
402
|
return $goodsInfo;
|
402
|
return $goodsInfo;
|
403
|
}
|
403
|
}
|
404
|
-
|
404
|
+
|
405
|
/**
|
405
|
/**
|
406
|
* 获取分类导航列表
|
406
|
* 获取分类导航列表
|
407
|
- *
|
407
|
+ *
|
408
|
* @param string $smallSortId
|
408
|
* @param string $smallSortId
|
409
|
* @return array
|
409
|
* @return array
|
410
|
*/
|
410
|
*/
|
411
|
- public static function getSortNav($smallSortId)
|
411
|
+ public static function getSortNav($smallSortId)
|
412
|
{
|
412
|
{
|
413
|
$key = WebCacheConfig::KEY_WEB_ITEM_SORT_DATA.'_'.$smallSortId;
|
413
|
$key = WebCacheConfig::KEY_WEB_ITEM_SORT_DATA.'_'.$smallSortId;
|
414
|
$navs = Cache::get($key);
|
414
|
$navs = Cache::get($key);
|
|
@@ -432,17 +432,17 @@ class ItemModel |
|
@@ -432,17 +432,17 @@ class ItemModel |
432
|
}
|
432
|
}
|
433
|
return $navs;
|
433
|
return $navs;
|
434
|
}
|
434
|
}
|
435
|
-
|
435
|
+
|
436
|
/**
|
436
|
/**
|
437
|
* 获取咨询列表
|
437
|
* 获取咨询列表
|
438
|
- *
|
438
|
+ *
|
439
|
* @param int $uid
|
439
|
* @param int $uid
|
440
|
* @param int $productId
|
440
|
* @param int $productId
|
441
|
* @param int $pageNum
|
441
|
* @param int $pageNum
|
442
|
* @param int $pageSize
|
442
|
* @param int $pageSize
|
443
|
* @return array
|
443
|
* @return array
|
444
|
*/
|
444
|
*/
|
445
|
- public static function getConsults($uid, $productId, $pageNum = 1, $pageSize = 30)
|
445
|
+ public static function getConsults($uid, $productId, $pageNum = 1, $pageSize = 30)
|
446
|
{
|
446
|
{
|
447
|
$result = array();
|
447
|
$result = array();
|
448
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
448
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
|
@@ -466,16 +466,16 @@ class ItemModel |
|
@@ -466,16 +466,16 @@ class ItemModel |
466
|
}
|
466
|
}
|
467
|
return $result;
|
467
|
return $result;
|
468
|
}
|
468
|
}
|
469
|
-
|
469
|
+
|
470
|
/**
|
470
|
/**
|
471
|
* 获取评论
|
471
|
* 获取评论
|
472
|
- *
|
472
|
+ *
|
473
|
* @param int $productId
|
473
|
* @param int $productId
|
474
|
* @param int $pageNum
|
474
|
* @param int $pageNum
|
475
|
* @param int $pageSize
|
475
|
* @param int $pageSize
|
476
|
- * @return array
|
476
|
+ * @return array
|
477
|
*/
|
477
|
*/
|
478
|
- public static function getComments($productId, $pageNum = 1, $pageSize = 10)
|
478
|
+ public static function getComments($productId, $pageNum = 1, $pageSize = 10)
|
479
|
{
|
479
|
{
|
480
|
$result = array();
|
480
|
$result = array();
|
481
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
481
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
|
@@ -503,10 +503,10 @@ class ItemModel |
|
@@ -503,10 +503,10 @@ class ItemModel |
503
|
}
|
503
|
}
|
504
|
return $result;
|
504
|
return $result;
|
505
|
}
|
505
|
}
|
506
|
-
|
506
|
+
|
507
|
/**
|
507
|
/**
|
508
|
* 获取商品活动banner
|
508
|
* 获取商品活动banner
|
509
|
- *
|
509
|
+ *
|
510
|
* @param int $productId
|
510
|
* @param int $productId
|
511
|
* @return array
|
511
|
* @return array
|
512
|
*/
|
512
|
*/
|
|
@@ -524,14 +524,14 @@ class ItemModel |
|
@@ -524,14 +524,14 @@ class ItemModel |
524
|
}
|
524
|
}
|
525
|
return $result;
|
525
|
return $result;
|
526
|
}
|
526
|
}
|
527
|
-
|
527
|
+
|
528
|
/**
|
528
|
/**
|
529
|
* 获取商品热区
|
529
|
* 获取商品热区
|
530
|
- *
|
530
|
+ *
|
531
|
* @param string $productId
|
531
|
* @param string $productId
|
532
|
* @return array
|
532
|
* @return array
|
533
|
*/
|
533
|
*/
|
534
|
- public static function getProductHotArea($productId)
|
534
|
+ public static function getProductHotArea($productId)
|
535
|
{
|
535
|
{
|
536
|
$result = array();
|
536
|
$result = array();
|
537
|
$data = ItemData::getProductHotArea($productId);
|
537
|
$data = ItemData::getProductHotArea($productId);
|
|
@@ -560,6 +560,7 @@ class ItemModel |
|
@@ -560,6 +560,7 @@ class ItemModel |
560
|
'href' => Helpers::getUrlBySkc($goods['goodsImagesList'][0]['productId'],
|
560
|
'href' => Helpers::getUrlBySkc($goods['goodsImagesList'][0]['productId'],
|
561
|
$goods['goodsImagesList'][0]['goodsId'], $val['product']['cnAlphabet']),
|
561
|
$goods['goodsImagesList'][0]['goodsId'], $val['product']['cnAlphabet']),
|
562
|
);
|
562
|
);
|
|
|
563
|
+ $point['href'] = $point['product']['href'];
|
563
|
}
|
564
|
}
|
564
|
}
|
565
|
}
|
565
|
if(!empty($point)) {
|
566
|
if(!empty($point)) {
|
|
@@ -567,17 +568,17 @@ class ItemModel |
|
@@ -567,17 +568,17 @@ class ItemModel |
567
|
}
|
568
|
}
|
568
|
}
|
569
|
}
|
569
|
if(!empty($temp)) {
|
570
|
if(!empty($temp)) {
|
570
|
- $result[] = $temp;
|
571
|
+ $result[] = $temp;
|
571
|
}
|
572
|
}
|
572
|
}
|
573
|
}
|
573
|
}
|
574
|
}
|
574
|
}
|
575
|
}
|
575
|
return $result;
|
576
|
return $result;
|
576
|
}
|
577
|
}
|
577
|
-
|
578
|
+
|
578
|
/**
|
579
|
/**
|
579
|
* 获取商品模特卡
|
580
|
* 获取商品模特卡
|
580
|
- *
|
581
|
+ *
|
581
|
* @param string $productId
|
582
|
* @param string $productId
|
582
|
* @return array
|
583
|
* @return array
|
583
|
*/
|
584
|
*/
|
|
@@ -599,7 +600,7 @@ class ItemModel |
|
@@ -599,7 +600,7 @@ class ItemModel |
599
|
}
|
600
|
}
|
600
|
return $result;
|
601
|
return $result;
|
601
|
}
|
602
|
}
|
602
|
-
|
603
|
+
|
603
|
/**
|
604
|
/**
|
604
|
* 添加咨询
|
605
|
* 添加咨询
|
605
|
*
|
606
|
*
|
|
@@ -612,10 +613,10 @@ class ItemModel |
|
@@ -612,10 +613,10 @@ class ItemModel |
612
|
{
|
613
|
{
|
613
|
return ItemData::addConsult($uid, $productId, $content);
|
614
|
return ItemData::addConsult($uid, $productId, $content);
|
614
|
}
|
615
|
}
|
615
|
-
|
616
|
+
|
616
|
/**
|
617
|
/**
|
617
|
* 获取商品的舒适度
|
618
|
* 获取商品的舒适度
|
618
|
- *
|
619
|
+ *
|
619
|
* @param int $productId
|
620
|
* @param int $productId
|
620
|
* @return array
|
621
|
* @return array
|
621
|
*/
|
622
|
*/
|
|
@@ -651,7 +652,7 @@ class ItemModel |
|
@@ -651,7 +652,7 @@ class ItemModel |
651
|
}
|
652
|
}
|
652
|
return $result;
|
653
|
return $result;
|
653
|
}
|
654
|
}
|
654
|
-
|
655
|
+
|
655
|
/**
|
656
|
/**
|
656
|
* 获取商品的喜欢
|
657
|
* 获取商品的喜欢
|
657
|
* @param int $uid
|
658
|
* @param int $uid
|
|
@@ -677,10 +678,10 @@ class ItemModel |
|
@@ -677,10 +678,10 @@ class ItemModel |
677
|
}
|
678
|
}
|
678
|
return $result;
|
679
|
return $result;
|
679
|
}
|
680
|
}
|
680
|
-
|
681
|
+
|
681
|
/**
|
682
|
/**
|
682
|
* 根据商品信息设置并发请求
|
683
|
* 根据商品信息设置并发请求
|
683
|
- *
|
684
|
+ *
|
684
|
* @param array $productInfo
|
685
|
* @param array $productInfo
|
685
|
*/
|
686
|
*/
|
686
|
private static function setMultiResourceByProductBaseInfo(&$baseInfo)
|
687
|
private static function setMultiResourceByProductBaseInfo(&$baseInfo)
|
|
@@ -703,10 +704,10 @@ class ItemModel |
|
@@ -703,10 +704,10 @@ class ItemModel |
703
|
}
|
704
|
}
|
704
|
self::$multiResources = Yohobuy::getMulti($multiResourcesUrl, array(), false, 5, true);
|
705
|
self::$multiResources = Yohobuy::getMulti($multiResourcesUrl, array(), false, 5, true);
|
705
|
}
|
706
|
}
|
706
|
-
|
707
|
+
|
707
|
/**
|
708
|
/**
|
708
|
* 根据资源名称获取并发数据
|
709
|
* 根据资源名称获取并发数据
|
709
|
- *
|
710
|
+ *
|
710
|
* @param string $resourceName
|
711
|
* @param string $resourceName
|
711
|
* @return array
|
712
|
* @return array
|
712
|
*/
|
713
|
*/
|
|
@@ -718,13 +719,13 @@ class ItemModel |
|
@@ -718,13 +719,13 @@ class ItemModel |
718
|
return false;
|
719
|
return false;
|
719
|
}
|
720
|
}
|
720
|
}
|
721
|
}
|
721
|
-
|
722
|
+
|
722
|
/**
|
723
|
/**
|
723
|
* 根据最大分类ID获取尺寸属性
|
724
|
* 根据最大分类ID获取尺寸属性
|
724
|
- *
|
725
|
+ *
|
725
|
* @param string $maxSortId
|
726
|
* @param string $maxSortId
|
726
|
* @param array $sizeList
|
727
|
* @param array $sizeList
|
727
|
- * @return array
|
728
|
+ * @return array
|
728
|
*/
|
729
|
*/
|
729
|
private static function getSizeAttrByMaxSortId($maxSortId, array $sizeList)
|
730
|
private static function getSizeAttrByMaxSortId($maxSortId, array $sizeList)
|
730
|
{
|
731
|
{
|
|
@@ -746,7 +747,7 @@ class ItemModel |
|
@@ -746,7 +747,7 @@ class ItemModel |
746
|
foreach($sizeList['sizeAttributeBos'] as $size) {
|
747
|
foreach($sizeList['sizeAttributeBos'] as $size) {
|
747
|
$attributeNames[$size['id']] = $size['attributeName'];
|
748
|
$attributeNames[$size['id']] = $size['attributeName'];
|
748
|
}
|
749
|
}
|
749
|
-
|
750
|
+
|
750
|
foreach($sizeList['sizeBoList'] as $size) {
|
751
|
foreach($sizeList['sizeBoList'] as $size) {
|
751
|
$sizeValues = array();
|
752
|
$sizeValues = array();
|
752
|
foreach($size['sortAttributes'] as $sort) {
|
753
|
foreach($size['sortAttributes'] as $sort) {
|
|
@@ -763,14 +764,14 @@ class ItemModel |
|
@@ -763,14 +764,14 @@ class ItemModel |
763
|
}
|
764
|
}
|
764
|
return $sizeInfos;
|
765
|
return $sizeInfos;
|
765
|
}
|
766
|
}
|
766
|
-
|
767
|
+
|
767
|
/**
|
768
|
/**
|
768
|
* 获取尺寸信息
|
769
|
* 获取尺寸信息
|
769
|
- *
|
770
|
+ *
|
770
|
* @param array $sizeInfo
|
771
|
* @param array $sizeInfo
|
771
|
- * @return array
|
772
|
+ * @return array
|
772
|
*/
|
773
|
*/
|
773
|
- private static function getSizeDataBySizeInfo(array &$sizeInfo)
|
774
|
+ private static function getSizeDataBySizeInfo(array &$sizeInfo)
|
774
|
{
|
775
|
{
|
775
|
$size = array();
|
776
|
$size = array();
|
776
|
// 尺码信息
|
777
|
// 尺码信息
|
|
@@ -791,7 +792,7 @@ class ItemModel |
|
@@ -791,7 +792,7 @@ class ItemModel |
791
|
// 判断是否显示参考尺码
|
792
|
// 判断是否显示参考尺码
|
792
|
$showReference = ($boyReference && !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['boyReferSize'])) ||
|
793
|
$showReference = ($boyReference && !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['boyReferSize'])) ||
|
793
|
($girlReference && !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['girlReferSize']) );
|
794
|
($girlReference && !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['girlReferSize']) );
|
794
|
-
|
795
|
+
|
795
|
if (!empty($sizeInfo['sizeInfoBo']['sizeAttributeBos'])) {
|
796
|
if (!empty($sizeInfo['sizeInfoBo']['sizeAttributeBos'])) {
|
796
|
//尺码信息头部
|
797
|
//尺码信息头部
|
797
|
$size['thead'] = array(0 => array('name' => '吊牌尺码', 'id' => ''));
|
798
|
$size['thead'] = array(0 => array('name' => '吊牌尺码', 'id' => ''));
|
|
@@ -814,7 +815,7 @@ class ItemModel |
|
@@ -814,7 +815,7 @@ class ItemModel |
814
|
} else {
|
815
|
} else {
|
815
|
if(isset($size['thead'][1]) && $showReference) {
|
816
|
if(isset($size['thead'][1]) && $showReference) {
|
816
|
$size['thead'][1] = array();
|
817
|
$size['thead'][1] = array();
|
817
|
- }
|
818
|
+ }
|
818
|
}
|
819
|
}
|
819
|
//其他尺码信息
|
820
|
//其他尺码信息
|
820
|
foreach ($value['sortAttributes'] as $attr) {
|
821
|
foreach ($value['sortAttributes'] as $attr) {
|
|
@@ -830,14 +831,14 @@ class ItemModel |
|
@@ -830,14 +831,14 @@ class ItemModel |
830
|
}
|
831
|
}
|
831
|
}
|
832
|
}
|
832
|
}
|
833
|
}
|
833
|
-
|
834
|
+
|
834
|
// 测量方式
|
835
|
// 测量方式
|
835
|
if (!empty($sizeInfo['sizeImage'])) {
|
836
|
if (!empty($sizeInfo['sizeImage'])) {
|
836
|
$size['sizeImg'] = $sizeInfo['sizeImage'];
|
837
|
$size['sizeImg'] = $sizeInfo['sizeImage'];
|
837
|
}
|
838
|
}
|
838
|
return $size;
|
839
|
return $size;
|
839
|
}
|
840
|
}
|
840
|
-
|
841
|
+
|
841
|
/**
|
842
|
/**
|
842
|
* 使sizeBoList id以 sizeAttributeBos id顺序一样
|
843
|
* 使sizeBoList id以 sizeAttributeBos id顺序一样
|
843
|
* @param type array $sizeInfoBo
|
844
|
* @param type array $sizeInfoBo
|
|
@@ -848,7 +849,7 @@ class ItemModel |
|
@@ -848,7 +849,7 @@ class ItemModel |
848
|
if (empty($sizeInfoBo['sizeBoList']) || empty($sizeInfoBo['sizeAttributeBos'])) {
|
849
|
if (empty($sizeInfoBo['sizeBoList']) || empty($sizeInfoBo['sizeAttributeBos'])) {
|
849
|
return array();
|
850
|
return array();
|
850
|
}
|
851
|
}
|
851
|
-
|
852
|
+
|
852
|
foreach ($sizeInfoBo['sizeBoList'] as $sizek => $sizeBoList) {
|
853
|
foreach ($sizeInfoBo['sizeBoList'] as $sizek => $sizeBoList) {
|
853
|
$sortArr = array();
|
854
|
$sortArr = array();
|
854
|
foreach ($sizeBoList['sortAttributes'] as $sortAttributes) {
|
855
|
foreach ($sizeBoList['sortAttributes'] as $sortAttributes) {
|
|
@@ -856,7 +857,7 @@ class ItemModel |
|
@@ -856,7 +857,7 @@ class ItemModel |
856
|
}
|
857
|
}
|
857
|
$sizeInfoBo['sizeBoList'][$sizek]['sortAttributes'] = $sortArr;
|
858
|
$sizeInfoBo['sizeBoList'][$sizek]['sortAttributes'] = $sortArr;
|
858
|
}
|
859
|
}
|
859
|
-
|
860
|
+
|
860
|
foreach ($sizeInfoBo['sizeBoList'] as $sizek => $sizeBoList) {
|
861
|
foreach ($sizeInfoBo['sizeBoList'] as $sizek => $sizeBoList) {
|
861
|
$sortArr = array();
|
862
|
$sortArr = array();
|
862
|
foreach ($sizeInfoBo['sizeAttributeBos'] as $val) {
|
863
|
foreach ($sizeInfoBo['sizeAttributeBos'] as $val) {
|
|
@@ -864,17 +865,17 @@ class ItemModel |
|
@@ -864,17 +865,17 @@ class ItemModel |
864
|
}
|
865
|
}
|
865
|
$sizeInfoBo['sizeBoList'][$sizek]['sortAttributes'] = $sortArr;
|
866
|
$sizeInfoBo['sizeBoList'][$sizek]['sortAttributes'] = $sortArr;
|
866
|
}
|
867
|
}
|
867
|
-
|
868
|
+
|
868
|
return $sizeInfoBo;
|
869
|
return $sizeInfoBo;
|
869
|
}
|
870
|
}
|
870
|
-
|
871
|
+
|
871
|
/**
|
872
|
/**
|
872
|
* 获取模特数据
|
873
|
* 获取模特数据
|
873
|
- *
|
874
|
+ *
|
874
|
* @param array $sizeInfo
|
875
|
* @param array $sizeInfo
|
875
|
- * @return array
|
876
|
+ * @return array
|
876
|
*/
|
877
|
*/
|
877
|
- private static function getReferenceDataBySizeInfo(array &$sizeInfo)
|
878
|
+ private static function getReferenceDataBySizeInfo(array &$sizeInfo)
|
878
|
{
|
879
|
{
|
879
|
$reference = array();
|
880
|
$reference = array();
|
880
|
if (!empty($sizeInfo['modelBos'])) {
|
881
|
if (!empty($sizeInfo['modelBos'])) {
|
|
@@ -903,14 +904,14 @@ class ItemModel |
|
@@ -903,14 +904,14 @@ class ItemModel |
903
|
}
|
904
|
}
|
904
|
return $reference;
|
905
|
return $reference;
|
905
|
}
|
906
|
}
|
906
|
-
|
907
|
+
|
907
|
/**
|
908
|
/**
|
908
|
* 获取洗涤材质
|
909
|
* 获取洗涤材质
|
909
|
- *
|
910
|
+ *
|
910
|
* @param array $sizeInfo
|
911
|
* @param array $sizeInfo
|
911
|
* @return array
|
912
|
* @return array
|
912
|
*/
|
913
|
*/
|
913
|
- private static function getMaterialDataBySizeInfo(array &$sizeInfo)
|
914
|
+ private static function getMaterialDataBySizeInfo(array &$sizeInfo)
|
914
|
{
|
915
|
{
|
915
|
$material = array();
|
916
|
$material = array();
|
916
|
//洗涤提示
|
917
|
//洗涤提示
|
|
@@ -920,7 +921,7 @@ class ItemModel |
|
@@ -920,7 +921,7 @@ class ItemModel |
920
|
$material['wash'][] = array('name' => $value['caption'],'img' => $value['img']);
|
921
|
$material['wash'][] = array('name' => $value['caption'],'img' => $value['img']);
|
921
|
}
|
922
|
}
|
922
|
}
|
923
|
}
|
923
|
-
|
924
|
+
|
924
|
if (!empty($sizeInfo['productMaterialList'])) {
|
925
|
if (!empty($sizeInfo['productMaterialList'])) {
|
925
|
//商品材质[洗涤说明]
|
926
|
//商品材质[洗涤说明]
|
926
|
$material['materialDetail'] = array();
|
927
|
$material['materialDetail'] = array();
|
|
@@ -935,14 +936,14 @@ class ItemModel |
|
@@ -935,14 +936,14 @@ class ItemModel |
935
|
}
|
936
|
}
|
936
|
return $material;
|
937
|
return $material;
|
937
|
}
|
938
|
}
|
938
|
-
|
939
|
+
|
939
|
/**
|
940
|
/**
|
940
|
* 获取描述数据
|
941
|
* 获取描述数据
|
941
|
- *
|
942
|
+ *
|
942
|
* @param array $sizeInfo
|
943
|
* @param array $sizeInfo
|
943
|
* @return array
|
944
|
* @return array
|
944
|
*/
|
945
|
*/
|
945
|
- private static function getDescriptionDataBySizeInfo(array &$sizeInfo)
|
946
|
+ private static function getDescriptionDataBySizeInfo(array &$sizeInfo)
|
946
|
{
|
947
|
{
|
947
|
$description = array();
|
948
|
$description = array();
|
948
|
// 商品信息
|
949
|
// 商品信息
|
|
@@ -968,14 +969,14 @@ class ItemModel |
|
@@ -968,14 +969,14 @@ class ItemModel |
968
|
}
|
969
|
}
|
969
|
return $description;
|
970
|
return $description;
|
970
|
}
|
971
|
}
|
971
|
-
|
972
|
+
|
972
|
/**
|
973
|
/**
|
973
|
* 获取商品详情页介绍
|
974
|
* 获取商品详情页介绍
|
974
|
- *
|
975
|
+ *
|
975
|
* @param array $sizeInfo
|
976
|
* @param array $sizeInfo
|
976
|
* @return string
|
977
|
* @return string
|
977
|
*/
|
978
|
*/
|
978
|
- private static function getDetailDataBySizeInfo(array &$sizeInfo)
|
979
|
+ private static function getDetailDataBySizeInfo(array &$sizeInfo)
|
979
|
{
|
980
|
{
|
980
|
$details = '';
|
981
|
$details = '';
|
981
|
// 详情配图
|
982
|
// 详情配图
|
|
@@ -992,14 +993,14 @@ class ItemModel |
|
@@ -992,14 +993,14 @@ class ItemModel |
992
|
}
|
993
|
}
|
993
|
return $details;
|
994
|
return $details;
|
994
|
}
|
995
|
}
|
995
|
-
|
996
|
+
|
996
|
/**
|
997
|
/**
|
997
|
* 获取sku商品数据
|
998
|
* 获取sku商品数据
|
998
|
- *
|
999
|
+ *
|
999
|
* @param array $baseInfo
|
1000
|
* @param array $baseInfo
|
1000
|
- * @return array
|
1001
|
+ * @return array
|
1001
|
*/
|
1002
|
*/
|
1002
|
- private static function getSkuDataByProductBaseInfo(array &$baseInfo)
|
1003
|
+ private static function getSkuDataByProductBaseInfo(array &$baseInfo)
|
1003
|
{
|
1004
|
{
|
1004
|
$totalStorageNum = 0;
|
1005
|
$totalStorageNum = 0;
|
1005
|
$skuGoods = array();//sku商品
|
1006
|
$skuGoods = array();//sku商品
|
|
@@ -1008,8 +1009,8 @@ class ItemModel |
|
@@ -1008,8 +1009,8 @@ class ItemModel |
1008
|
if (!empty($baseInfo['goodsList'])) {
|
1009
|
if (!empty($baseInfo['goodsList'])) {
|
1009
|
$goodsGroup = array();
|
1010
|
$goodsGroup = array();
|
1010
|
foreach ($baseInfo['goodsList'] as $pos => $value) {
|
1011
|
foreach ($baseInfo['goodsList'] as $pos => $value) {
|
1011
|
-
|
|
|
1012
|
- // 如果status为0,即skc下架时就跳过该商品$value['status'] === 0
|
1012
|
+
|
|
|
1013
|
+ // 如果status为0,即skc下架时就跳过该商品$value['status'] === 0
|
1013
|
if (empty($value['colorImage']) ) {
|
1014
|
if (empty($value['colorImage']) ) {
|
1014
|
continue;
|
1015
|
continue;
|
1015
|
}
|
1016
|
}
|
|
@@ -1025,7 +1026,7 @@ class ItemModel |
|
@@ -1025,7 +1026,7 @@ class ItemModel |
1025
|
'thumbs' => array(),
|
1026
|
'thumbs' => array(),
|
1026
|
'size' => array(),
|
1027
|
'size' => array(),
|
1027
|
);
|
1028
|
);
|
1028
|
-
|
1029
|
+
|
1029
|
foreach ($value['goodsImagesList'] as $goods) {
|
1030
|
foreach ($value['goodsImagesList'] as $goods) {
|
1030
|
if(!empty($goods['imageUrl'])) {
|
1031
|
if(!empty($goods['imageUrl'])) {
|
1031
|
$goodsGroup['thumbs'][] = array(
|
1032
|
$goodsGroup['thumbs'][] = array(
|
|
@@ -1034,17 +1035,17 @@ class ItemModel |
|
@@ -1034,17 +1035,17 @@ class ItemModel |
1034
|
);
|
1035
|
);
|
1035
|
}
|
1036
|
}
|
1036
|
}
|
1037
|
}
|
1037
|
-
|
1038
|
+
|
1038
|
//缩略图空,不显示
|
1039
|
//缩略图空,不显示
|
1039
|
if(empty($goodsGroup['thumbs'])) {
|
1040
|
if(empty($goodsGroup['thumbs'])) {
|
1040
|
continue;
|
1041
|
continue;
|
1041
|
}
|
1042
|
}
|
1042
|
-
|
1043
|
+
|
1043
|
//默认第一张图片
|
1044
|
//默认第一张图片
|
1044
|
if($pos == 0) {
|
1045
|
if($pos == 0) {
|
1045
|
$defaultImage = Images::getImageUrl($value['colorImage'], 420, 560);
|
1046
|
$defaultImage = Images::getImageUrl($value['colorImage'], 420, 560);
|
1046
|
}
|
1047
|
}
|
1047
|
-
|
1048
|
+
|
1048
|
//商品的尺码列表
|
1049
|
//商品的尺码列表
|
1049
|
foreach ($value['goodsSizeBoList'] as $size) {
|
1050
|
foreach ($value['goodsSizeBoList'] as $size) {
|
1050
|
if($baseInfo['attribute'] == 3 ) { //虚拟商品,增加为一件
|
1051
|
if($baseInfo['attribute'] == 3 ) { //虚拟商品,增加为一件
|
|
@@ -1062,7 +1063,7 @@ class ItemModel |
|
@@ -1062,7 +1063,7 @@ class ItemModel |
1062
|
);
|
1063
|
);
|
1063
|
//单个sku商品的总数
|
1064
|
//单个sku商品的总数
|
1064
|
$goodsGroup['total'] += intval($size['goodsSizeStorageNum']);
|
1065
|
$goodsGroup['total'] += intval($size['goodsSizeStorageNum']);
|
1065
|
-
|
1066
|
+
|
1066
|
if($goodsGroup['total']> 0 && !$chooseSkuFlag) { //默认选中该sku商品
|
1067
|
if($goodsGroup['total']> 0 && !$chooseSkuFlag) { //默认选中该sku商品
|
1067
|
$goodsGroup['focus'] = true;
|
1068
|
$goodsGroup['focus'] = true;
|
1068
|
$chooseSkuFlag = true;//选中sku商品
|
1069
|
$chooseSkuFlag = true;//选中sku商品
|
|
@@ -1079,14 +1080,14 @@ class ItemModel |
|
@@ -1079,14 +1080,14 @@ class ItemModel |
1079
|
return array('skuGoods' => $skuGoods,'totalStorageNum' => $totalStorageNum,
|
1080
|
return array('skuGoods' => $skuGoods,'totalStorageNum' => $totalStorageNum,
|
1080
|
'defaultImage' => $defaultImage);
|
1081
|
'defaultImage' => $defaultImage);
|
1081
|
}
|
1082
|
}
|
1082
|
-
|
1083
|
+
|
1083
|
/**
|
1084
|
/**
|
1084
|
* 获取品牌数据
|
1085
|
* 获取品牌数据
|
1085
|
- *
|
1086
|
+ *
|
1086
|
* @param array $baseInfo
|
1087
|
* @param array $baseInfo
|
1087
|
* @return array
|
1088
|
* @return array
|
1088
|
*/
|
1089
|
*/
|
1089
|
- private static function getBrandDataByProductBaseInfo(array &$baseInfo)
|
1090
|
+ private static function getBrandDataByProductBaseInfo(array &$baseInfo)
|
1090
|
{
|
1091
|
{
|
1091
|
if(empty($baseInfo['brand'])) {
|
1092
|
if(empty($baseInfo['brand'])) {
|
1092
|
return array();
|
1093
|
return array();
|
|
@@ -1107,12 +1108,12 @@ class ItemModel |
|
@@ -1107,12 +1108,12 @@ class ItemModel |
1107
|
if(!empty($bannerInfo['bannerUrl'])) {
|
1108
|
if(!empty($bannerInfo['bannerUrl'])) {
|
1108
|
$bgImg = Images::getForceSourceUrl($bannerInfo['bannerUrl']);
|
1109
|
$bgImg = Images::getForceSourceUrl($bannerInfo['bannerUrl']);
|
1109
|
}
|
1110
|
}
|
1110
|
- }
|
1111
|
+ }
|
1111
|
//banner的logo
|
1112
|
//banner的logo
|
1112
|
- if(!empty($bannerInfo['logo']))
|
1113
|
+ if(!empty($bannerInfo['logo']))
|
1113
|
{
|
1114
|
{
|
1114
|
$logo = Images::getForceSourceUrl($bannerInfo['logo']);
|
1115
|
$logo = Images::getForceSourceUrl($bannerInfo['logo']);
|
1115
|
- }
|
1116
|
+ }
|
1116
|
$homeUrl = 'javascript:void(0)';
|
1117
|
$homeUrl = 'javascript:void(0)';
|
1117
|
if(!empty($baseInfo['brand']['brandDomain'])){
|
1118
|
if(!empty($baseInfo['brand']['brandDomain'])){
|
1118
|
$homeUrl = Helpers::url('', array(), $baseInfo['brand']['brandDomain']);
|
1119
|
$homeUrl = Helpers::url('', array(), $baseInfo['brand']['brandDomain']);
|
|
@@ -1130,16 +1131,16 @@ class ItemModel |
|
@@ -1130,16 +1131,16 @@ class ItemModel |
1130
|
'isCollect'=> false
|
1131
|
'isCollect'=> false
|
1131
|
);
|
1132
|
);
|
1132
|
}
|
1133
|
}
|
1133
|
-
|
1134
|
+
|
1134
|
/**
|
1135
|
/**
|
1135
|
* 获取vip数据
|
1136
|
* 获取vip数据
|
1136
|
- *
|
1137
|
+ *
|
1137
|
* @param array $baseInfo
|
1138
|
* @param array $baseInfo
|
1138
|
* @param int $vipLevel
|
1139
|
* @param int $vipLevel
|
1139
|
* @param int $uid
|
1140
|
* @param int $uid
|
1140
|
* @return array
|
1141
|
* @return array
|
1141
|
*/
|
1142
|
*/
|
1142
|
- private static function getVipDataByProductBaseInfo(array &$baseInfo, $vipLevel = 0, $uid = 0)
|
1143
|
+ private static function getVipDataByProductBaseInfo(array &$baseInfo, $vipLevel = 0, $uid = 0)
|
1143
|
{
|
1144
|
{
|
1144
|
$vipData = array();
|
1145
|
$vipData = array();
|
1145
|
if (!empty($baseInfo['productPriceBo']['vipPrices'])) {
|
1146
|
if (!empty($baseInfo['productPriceBo']['vipPrices'])) {
|
|
@@ -1167,10 +1168,10 @@ class ItemModel |
|
@@ -1167,10 +1168,10 @@ class ItemModel |
1167
|
}
|
1168
|
}
|
1168
|
return $vipData;
|
1169
|
return $vipData;
|
1169
|
}
|
1170
|
}
|
1170
|
-
|
1171
|
+
|
1171
|
/**
|
1172
|
/**
|
1172
|
* 获取活动数据(促销相关活动)
|
1173
|
* 获取活动数据(促销相关活动)
|
1173
|
- *
|
1174
|
+ *
|
1174
|
* @param array $baseInfo
|
1175
|
* @param array $baseInfo
|
1175
|
* @return array
|
1176
|
* @return array
|
1176
|
*/
|
1177
|
*/
|
|
@@ -1194,10 +1195,10 @@ class ItemModel |
|
@@ -1194,10 +1195,10 @@ class ItemModel |
1194
|
}
|
1195
|
}
|
1195
|
return $activity;
|
1196
|
return $activity;
|
1196
|
}
|
1197
|
}
|
1197
|
-
|
1198
|
+
|
1198
|
/**
|
1199
|
/**
|
1199
|
* 获取标签相关数据
|
1200
|
* 获取标签相关数据
|
1200
|
- *
|
1201
|
+ *
|
1201
|
* @param array $baseInfo
|
1202
|
* @param array $baseInfo
|
1202
|
* @return array
|
1203
|
* @return array
|
1203
|
*/
|
1204
|
*/
|
|
@@ -1236,12 +1237,12 @@ class ItemModel |
|
@@ -1236,12 +1237,12 @@ class ItemModel |
1236
|
}
|
1237
|
}
|
1237
|
return $tags;
|
1238
|
return $tags;
|
1238
|
}
|
1239
|
}
|
1239
|
-
|
1240
|
+
|
1240
|
/**
|
1241
|
/**
|
1241
|
* 获取模特试穿
|
1242
|
* 获取模特试穿
|
1242
|
- *
|
1243
|
+ *
|
1243
|
* @param string $productSkn
|
1244
|
* @param string $productSkn
|
1244
|
- * @return array
|
1245
|
+ * @return array
|
1245
|
*/
|
1246
|
*/
|
1246
|
public static function getProductModelTry($productSkn)
|
1247
|
public static function getProductModelTry($productSkn)
|
1247
|
{
|
1248
|
{
|
|
@@ -1270,11 +1271,11 @@ class ItemModel |
|
@@ -1270,11 +1271,11 @@ class ItemModel |
1270
|
}
|
1271
|
}
|
1271
|
return $modelTry;
|
1272
|
return $modelTry;
|
1272
|
}
|
1273
|
}
|
1273
|
-
|
1274
|
+
|
1274
|
/**
|
1275
|
/**
|
1275
|
* 处理限购商品的有关按钮状态(或取现购买以及底部商品购买按钮)
|
1276
|
* 处理限购商品的有关按钮状态(或取现购买以及底部商品购买按钮)
|
1276
|
*
|
1277
|
*
|
1277
|
- * @param int $uid
|
1278
|
+ * @param int $uid
|
1278
|
* @param int $showStatus 限购商品的关联状态
|
1279
|
* @param int $showStatus 限购商品的关联状态
|
1279
|
* @param boolean $isBeginSale 限购商品是否已开售
|
1280
|
* @param boolean $isBeginSale 限购商品是否已开售
|
1280
|
*/
|
1281
|
*/
|
|
@@ -1287,8 +1288,8 @@ class ItemModel |
|
@@ -1287,8 +1288,8 @@ class ItemModel |
1287
|
//openSoon//即将开售
|
1288
|
//openSoon//即将开售
|
1288
|
//dis //失效
|
1289
|
//dis //失效
|
1289
|
//buyNow //是否立即购买
|
1290
|
//buyNow //是否立即购买
|
1290
|
- $result = array('getLimitedCode' => false, 'hasLimitedCode' => false,
|
|
|
1291
|
- 'limitedCodeSoldOut' => false, 'openSoon' => false, 'dis' => false,
|
1291
|
+ $result = array('getLimitedCode' => false, 'hasLimitedCode' => false,
|
|
|
1292
|
+ 'limitedCodeSoldOut' => false, 'openSoon' => false, 'dis' => false,
|
1292
|
'buyNow' => false, 'soldOut'=> false, 'getLimitedCodeDis'=> false);
|
1293
|
'buyNow' => false, 'soldOut'=> false, 'getLimitedCodeDis'=> false);
|
1293
|
// 显示获取限购码按钮
|
1294
|
// 显示获取限购码按钮
|
1294
|
$result['getLimitedCode'] = true;
|
1295
|
$result['getLimitedCode'] = true;
|
|
@@ -1326,14 +1327,14 @@ class ItemModel |
|
@@ -1326,14 +1327,14 @@ class ItemModel |
1326
|
$result['hasLimitedCode'] = true;
|
1327
|
$result['hasLimitedCode'] = true;
|
1327
|
$result['limitedCodeSoldOut'] = true;
|
1328
|
$result['limitedCodeSoldOut'] = true;
|
1328
|
$result['getLimitedCode'] = false;
|
1329
|
$result['getLimitedCode'] = false;
|
1329
|
-
|
1330
|
+
|
1330
|
break;
|
1331
|
break;
|
1331
|
case 6: // 开售前,即将开售(用户已领取限购码)
|
1332
|
case 6: // 开售前,即将开售(用户已领取限购码)
|
1332
|
$result['openSoon'] = true;
|
1333
|
$result['openSoon'] = true;
|
1333
|
$result['hasLimitedCode'] = true;
|
1334
|
$result['hasLimitedCode'] = true;
|
1334
|
if(!empty($uid)) {//限购码失效
|
1335
|
if(!empty($uid)) {//限购码失效
|
1335
|
$result['getLimitedCodeDis'] = true;
|
1336
|
$result['getLimitedCodeDis'] = true;
|
1336
|
- }
|
1337
|
+ }
|
1337
|
break;
|
1338
|
break;
|
1338
|
case 7: // 开售后,用户已经用获得的限购码购买过商品
|
1339
|
case 7: // 开售后,用户已经用获得的限购码购买过商品
|
1339
|
$result['buyNow'] = true;
|
1340
|
$result['buyNow'] = true;
|
|
@@ -1346,12 +1347,12 @@ class ItemModel |
|
@@ -1346,12 +1347,12 @@ class ItemModel |
1346
|
break;
|
1347
|
break;
|
1347
|
}
|
1348
|
}
|
1348
|
return $result;
|
1349
|
return $result;
|
1349
|
-
|
1350
|
+
|
1350
|
}
|
1351
|
}
|
1351
|
-
|
1352
|
+
|
1352
|
/**
|
1353
|
/**
|
1353
|
* 获取商品咨询和评论数据
|
1354
|
* 获取商品咨询和评论数据
|
1354
|
- *
|
1355
|
+ *
|
1355
|
* @param array $baseInfo
|
1356
|
* @param array $baseInfo
|
1356
|
* @return array
|
1357
|
* @return array
|
1357
|
*/
|
1358
|
*/
|
|
@@ -1373,5 +1374,5 @@ class ItemModel |
|
@@ -1373,5 +1374,5 @@ class ItemModel |
1373
|
}
|
1374
|
}
|
1374
|
return $consultComment;
|
1375
|
return $consultComment;
|
1375
|
}
|
1376
|
}
|
1376
|
-
|
|
|
1377
|
-} |
|
|
|
|
1377
|
+
|
|
|
1378
|
+} |