更新订单检查处理

This commit is contained in:
yaooo 2023-08-15 13:52:14 +08:00
parent c5ad186617
commit 3a35bb6056

View File

@ -100,6 +100,18 @@ class StoreOrderCreateRepository extends StoreOrderRepository
if ($order_type == 98 && count($merchantCartList) > 1) {
throw new ValidateException('采购商品不支持跨店购买');
}
$community = [];
if ($order_type == 98) {
$attrUniqueArray = [];
foreach($merchantCart['list'] as $prod){
$attrUniqueArray[] = $prod['product_attr_unique'];
}
$attrInfo = Db::name('Resale')->alias('r')->leftJoin('Community c','r.community_id = c.community_id')->whereIn('r.product_attr_unique', $attrUniqueArray)->distinct(true)->field('c.community_id, c.title, c.image')->fetchSql(false)->select();
if (count($attrInfo) > 1) {
throw new ValidateException('转售商品数据异常');
}
$community = $attrInfo[0] ?? [];
}
unset($merchantCart, $cart);
$order_price = 0;
@ -885,6 +897,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
'order_total_postage',
'order_price',
'total_price',
'community',
'platformCoupon',
'enabledPlatformCoupon',
'usePlatformCouponId',