|
|
|
@ -538,6 +538,8 @@ class Goods extends GoodsModel |
|
|
|
|
{ |
|
|
|
|
// 获取商品记录 |
|
|
|
|
$goodsInfo = static::detail($goodsId, $with); |
|
|
|
|
//单规格和多规格处理不一致 |
|
|
|
|
$goodsInfo->skuList = $goodsInfo->skuList1 ? $goodsInfo->skuList1 : $goodsInfo->skuList; |
|
|
|
|
|
|
|
|
|
if ($goodsInfo->skuList) { |
|
|
|
|
foreach ($goodsInfo->skuList as &$value) { |
|
|
|
@ -643,26 +645,26 @@ class Goods extends GoodsModel |
|
|
|
|
//价格判断 |
|
|
|
|
if (UserService::isstore()) { |
|
|
|
|
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds); |
|
|
|
|
$goods['goods_price_min_plus'] = round($priceArr['membershipPrice']); |
|
|
|
|
$goods['goods_price_min_dealer'] = round($priceArr['distributionPrice']); |
|
|
|
|
$goods['goods_price_min'] = round($goods['goods_price_min_plus']);//$goods['cost_price_min'];//店长售价,展示为成本价 |
|
|
|
|
$goods['goods_price_min_plus'] = $priceArr['membershipPrice']; |
|
|
|
|
$goods['goods_price_min_dealer'] = $priceArr['distributionPrice']; |
|
|
|
|
$goods['goods_price_min'] = $goods['goods_price_min_plus'];//$goods['cost_price_min'];//店长售价,展示为成本价 |
|
|
|
|
|
|
|
|
|
} elseif (UserService::isPlusMember()) { |
|
|
|
|
$membershipPrice = \app\common\model\PriceSet::membershipPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds); |
|
|
|
|
$goods['discount'] = bcdiv((string)($membershipPrice * 10), (string)$goods['goods_price_min'], 1); |
|
|
|
|
$goods['goods_price_min'] = round($membershipPrice); |
|
|
|
|
$goods['goods_price_min'] = $membershipPrice; |
|
|
|
|
} elseif (UserService::isDealerMember()) { |
|
|
|
|
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds); |
|
|
|
|
$goods['discount'] = bcdiv((string)($priceArr['distributionPrice'] * 10), (string)$goods['goods_price_min'], 1); |
|
|
|
|
//$goods['goods_price_min'] = $membershipPrice; |
|
|
|
|
$goods['goods_price_min'] = round($priceArr['distributionPrice']); |
|
|
|
|
$goods['goods_price_min'] = $priceArr['distributionPrice']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($goods['discount'] == 10) { |
|
|
|
|
$goods['discount'] = 0.0; |
|
|
|
|
} |
|
|
|
|
// 会员折扣价: 商品sku列表 |
|
|
|
|
if ($goods->getRelation('skuList')) { |
|
|
|
|
if ($goods->getRelation('skuList') || $goods->getRelation('skuList1')) { |
|
|
|
|
|
|
|
|
|
foreach ($goods['skuList'] as &$skuItem) { |
|
|
|
|
//价格判断 |
|
|
|
|