feat(purchase): 采购产品供应商价格设置

- 在创建预订单时,将采购价格设置为供应商价格
- 调用 PurchaseProductOfferLogic 中的 setProductGroupPrice 方法完成价格设置
This commit is contained in:
mkm 2025-01-23 21:37:03 +08:00
parent c8560fafdc
commit 95a145db70

View File

@ -2,6 +2,7 @@
namespace app\admin\logic\beforehand_order_cart_info;
use app\admin\logic\purchase_product_offer\PurchaseProductOfferLogic;
use app\admin\logic\warehouse_product\WarehouseProductLogic;
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
use app\common\logic\BaseLogic;
@ -423,6 +424,11 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
// throw new BusinessException('入库失败,预订单更新出错');
// }
}
$purchaseProductOffer['purchase']=$purchaseProductOffer['price'];
$product = StoreProduct::where('id', $purchaseProductOffer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id,cate_id')->find();
PurchaseProductOfferLogic::setProductGroupPrice($purchaseProductOffer, $product);
Db::commit();
return true;
} catch (\Throwable $e) {