作者 何书鹏

活动未参与活动的规格不显示

... ... @@ -438,11 +438,12 @@ class Goods extends Model
$activity_goods_sku_price = $activity['activity_goods_sku_price'];
$new_sku_price = [];
foreach ($sku_price as $s => $k) {
$new_sku_price[$s] = $k;
$new_sku_price[$s]['stock'] = 0;
$new_sku_price[$s]['sales'] = 0;
// $new_sku_price[$s] = $k;
// $new_sku_price[$s]['stock'] = 0;
// $new_sku_price[$s]['sales'] = 0;
foreach ($activity_goods_sku_price as $c) {
if ($k['id'] == $c['sku_price_id']) {
$new_sku_price[$s] = $k;
// 采用活动的 规格内容
$new_sku_price[$s]['stock'] = $c['stock'];
$new_sku_price[$s]['sales'] = $c['sales'];
... ... @@ -465,12 +466,13 @@ class Goods extends Model
$activity_goods_sku_price = $activity['activity_goods_sku_price'];
$new_sku_price = [];
foreach ($sku_price as $s => $k) {
$new_sku_price[$s] = $k;
$new_sku_price[$s]['stock'] = 0;
$new_sku_price[$s]['sales'] = 0;
$new_sku_price[$s]['groupon_price'] = $k['price'];
// $new_sku_price[$s] = $k;
// $new_sku_price[$s]['stock'] = 0;
// $new_sku_price[$s]['sales'] = 0;
// $new_sku_price[$s]['groupon_price'] = $k['price'];
foreach ($activity_goods_sku_price as $c) {
if ($k['id'] == $c['sku_price_id']) {
$new_sku_price[$s] = $k;
// 采用活动的 规格内容
$new_sku_price[$s]['stock'] = $c['stock'];
$new_sku_price[$s]['sales'] = $c['sales'];
... ...