处理预售商品的错误

This commit is contained in:
luofei 2024-02-20 15:04:07 +08:00
parent 2c22405ebe
commit 764284256e

View File

@ -1286,9 +1286,9 @@ class ProductRepository extends BaseRepository
$attr = $this->detailAttr($res['attr']);
$attrValue = (in_array($res['product_type'], [3, 4])) ? $res['oldAttrValue'] : $res['attrValue'];
$oldProduct = Product::where('product_id', $res['old_product_id'])->field('product_id,stock')->find();
$activityId = CloudProduct::where('product_id', $res['product_id'])->value('activity_id');
$storeActivityId = CloudProduct::where('product_id', $res['product_id'])->value('activity_id');
$sku = $this->detailAttrValue($attrValue, $userInfo, $productType, $activityId);
if ($activityId == 2 && isset($oldProduct['stock'])) {
if ($storeActivityId == 2 && isset($oldProduct['stock'])) {
$res['stock'] = $oldProduct['stock'];
foreach ($sku as &$skuItem) {
$skuItem['stock'] = $oldProduct['stock'];