|
|
|
@ -583,12 +583,25 @@ class Goods extends GoodsModel |
|
|
|
|
* @return \app\common\model\GoodsSku|array|null |
|
|
|
|
* @throws BaseException |
|
|
|
|
*/ |
|
|
|
|
public static function getSkuInfo($goodsInfo, string $goodsSkuId, bool $enableGradeMoney = true) |
|
|
|
|
public static function getSkuInfo($goods, string $goodsSkuId, bool $enableGradeMoney = true) |
|
|
|
|
{ |
|
|
|
|
$goodsInfo['skuInfo'] = GoodsService::getSkuInfo($goodsInfo['goods_id'], $goodsSkuId); |
|
|
|
|
$goods['skuInfo'] = GoodsService::getSkuInfo($goods['goods_id'], $goodsSkuId); |
|
|
|
|
//$enableGradeMoney && (new static)->setGoodsGradeMoney($goodsInfo); |
|
|
|
|
(new static)->setGoodsMoney($goodsInfo); |
|
|
|
|
return $goodsInfo['skuInfo']; |
|
|
|
|
|
|
|
|
|
$catService = new GoodsCategoryRel(); |
|
|
|
|
$catIds = $catService->where(['goods_id' => $goods->goods_id])->column('category_id'); |
|
|
|
|
if ($goods->getAttr('skuInfo')) { |
|
|
|
|
if (UserService::isPlusMember()) { |
|
|
|
|
$goods['skuInfo']['goods_price'] = \app\common\model\PriceSet::membershipPrice($goods['skuInfo']['goods_price'], $goods['skuInfo']['cost_price'], $catIds); |
|
|
|
|
|
|
|
|
|
} elseif (UserService::isDealerMember()) { |
|
|
|
|
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['skuInfo']['goods_price'], $goods['skuInfo']['cost_price'], $catIds); |
|
|
|
|
$goods['skuInfo']['goods_price'] = $priceArr['distributionPrice']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//(new static)->setGoodsMoney($goodsInfo); |
|
|
|
|
return $goods['skuInfo']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|