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; }