作者 何书鹏

会员价

... ... @@ -503,9 +503,6 @@ class Goods extends Model
$new_sku_price[$s] = $k;
$new_sku_price[$s]['price'] = round($k['price'] * $basicConfig['discount'] / 10,2);
}
$sku_price = $new_sku_price;
$detail['price'] = round($detail['price'] * $basicConfig['discount'] / 10,2);
}
}
... ... @@ -521,10 +518,11 @@ class Goods extends Model
}
}
if ($activity) {
$prices = array_column($sku_price, 'price');
$detail['price'] = $prices ? min($prices) : 0; // min 里面不能是空数组
// 展示金额用规格最小值
$prices = array_column($sku_price, 'price');
$detail['price'] = $prices ? min($prices) : 0; // min 里面不能是空数组
if ($activity) {
if ($activity['type'] == 'groupon') {
$grouponPrices = array_column($sku_price, 'groupon_price');
$detail['groupon_price'] = $grouponPrices ? min($grouponPrices) : 0;
... ...