Merge pull request 'fix(admin): 修复已出库订单修改价格的问题' (#500) from dev into main

Reviewed-on: #500
This commit is contained in:
mkm 2025-02-03 13:53:26 +08:00
commit 4565edfe15

View File

@ -320,7 +320,11 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
public static function syncPrice($params)
{
$cartInfo = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->where('price', 0)->select()->toArray();
$outbound_id=BeforehandOrder::where('id', $params['bhoid'])->value('outbound_id');
if($outbound_id>0){
throw new BusinessException('该订单已出库,不能修改');
}
$cartInfo = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select()->toArray();
$productIds = array_column($cartInfo, 'product_id');
$products = StoreProduct::whereIn('id', $productIds)->select()->toArray();
$products = reset_index($products, 'id');