From ed103b2c7de00fd5ab398349051ea7bd01cdde4e Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Mon, 11 Mar 2024 12:23:24 +0800 Subject: [PATCH] 1 --- app/api/model/Goods.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/model/Goods.php b/app/api/model/Goods.php index 95a54449..b469f239 100644 --- a/app/api/model/Goods.php +++ b/app/api/model/Goods.php @@ -658,7 +658,7 @@ class Goods extends GoodsModel * @throws ModelNotFoundException */ public function editGoodsPrice($data) { - if (empty($data['goods_price']) || empty($data['line_price']) || empty($data['id'])) { + if (empty($data['goods_price']) || empty($data['cost_price']) || empty($data['id'])) { $this->error = "请补全信息"; return false; } @@ -678,16 +678,16 @@ class Goods extends GoodsModel foreach ($sku_ids as $sku_id) { $skuData = GoodsSkuModel::get(['id' => $sku_id,'goods_id' => $data['id']]); if ($skuData) { - $skuData->save(['goods_price' => $data['goods_price'], 'line_price' => $data['line_price']]); + $skuData->save(['goods_price' => $data['goods_price'], 'cost_price' => $data['cost_price']]); } } $skuList = GoodsSkuModel::getSkuList((int)$data['id']); [$data['goods_price_min'], $data['goods_price_max']] = GoodsSkuModel::getGoodsPrices($skuList->toArray()); - [$data['line_price_min'], $data['line_price_max']] = GoodsSkuModel::getLinePrices($skuList->toArray()); +// [$data['line_price_min'], $data['line_price_max']] = GoodsSkuModel::getLinePrices($skuList->toArray()); } elseif ($detail['spec_type'] == GoodsSpecTypeEnum::SINGLE) { $data['goods_price_min'] = $data['goods_price_max'] = $data['goods_price']; - $data['line_price_min'] = $data['line_price_max'] = $data['line_price']; +// $data['line_price_min'] = $data['line_price_max'] = $data['line_price']; } return $detail->save($data) !== false; }