...
|
...
|
@@ -44,6 +44,15 @@ class DetailModel |
|
|
if (empty($baseInfo['productName'])) {
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
// 是否为限购商品
|
|
|
$isLimited = ($baseInfo['isLimitBuy'] === 'Y');
|
|
|
// 如果未登录并且为限购商品,就跳转到登录页
|
|
|
if (empty($uid) && $isLimited) {
|
|
|
$result['needLogin'] = true;
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
$result['goodsName'] = $baseInfo['productName'];
|
|
|
|
|
|
// 商品促销短语
|
...
|
...
|
@@ -290,11 +299,6 @@ class DetailModel |
|
|
$soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0 || $totalStorageNum === 0);
|
|
|
$notForSale = $baseInfo['attribute'] == 2;
|
|
|
|
|
|
// 是否为限购商品
|
|
|
$isLimited = ($baseInfo['isLimitBuy'] === 'Y');
|
|
|
|
|
|
|
|
|
|
|
|
// 显示加入购物车链接
|
|
|
if (!$soldOut && !$notForSale && !$isLimited) {
|
|
|
ksort($colorGroup, SORT_NUMERIC);
|
...
|
...
|
@@ -744,20 +748,21 @@ class DetailModel |
|
|
/**
|
|
|
* 获取限购商品详情
|
|
|
*
|
|
|
* @param int $uid 用户UID
|
|
|
* @param string $productCode
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getLimitProductData($productCode)
|
|
|
public static function getLimitProductData($uid, $productCode)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
do {
|
|
|
if (empty($productCode)) {
|
|
|
if (empty($uid) || empty($productCode)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$product = DetailData::limitProductData($productCode);
|
|
|
$product = array(
|
|
|
$productData = DetailData::limitProductData($uid, $productCode);
|
|
|
/*$product = array(
|
|
|
"activityId" => null,
|
|
|
"attachment" => array(
|
|
|
array(
|
...
|
...
|
@@ -789,26 +794,26 @@ class DetailModel |
|
|
"saleTime" => 1454342400,
|
|
|
"showFlag" => 1,
|
|
|
"status" => 1
|
|
|
);
|
|
|
);*/
|
|
|
|
|
|
if (empty($product)) {
|
|
|
if (empty($productData)) {
|
|
|
break;
|
|
|
}
|
|
|
$product = $productData['data'];
|
|
|
|
|
|
$result['price'] = $product['price'];
|
|
|
$result['name'] = $product['productName'];
|
|
|
|
|
|
// 发售日期
|
|
|
$format = 'Y年m月';
|
|
|
if ($product['dayFlag']) { // 具体到日
|
|
|
$format .= 'd日';
|
|
|
}
|
|
|
$result['releaseDate'] = date($format, $product['saleTime']) . '发售';
|
|
|
$result['releaseDate'] = $product['saleTime'] . '发售';
|
|
|
// baner
|
|
|
$result['banner'] = $product['defaultUrl'];
|
|
|
$result['description'] = $product['description'];
|
|
|
|
|
|
// 附件
|
|
|
foreach ($product['attachment'] as $item) {
|
|
|
$result['attach'][] = self::procLimitProductAttach($item);
|
|
|
if (isset($product['attachment'])) {
|
|
|
foreach ($product['attachment'] as $item) {
|
|
|
$result['attach'][] = self::procLimitProductAttach($item);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} while (false);
|
...
|
...
|
|