更新委托商品收货方式

This commit is contained in:
yaooo 2023-09-08 16:50:18 +08:00
parent f9569be7dc
commit efe8b7c6ce

View File

@ -119,24 +119,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
}
}
}
if ($order_type == 99) {
$sourceIdArray = [];
foreach($merchantCart['list'] as $prod){
if ($prod['source_id'] > 0) {
$sourceIdArray[] = $prod['source_id'];
}
}
if (count($sourceIdArray)) {
if (count(array_unique($sourceIdArray)) > 1) {
throw new ValidateException('委托商品数据异常');
}
$community = Db::name('Community')->where('community_id', $sourceIdArray[0] ?? 0)->field('community_id, title, image')->fetchSql(false)->find();
if ($community) {
$deliverMethod = Db::name('entrust')->where('community_id', $sourceIdArray[0] ?? 0)->value('deliver_method');
$deliverMethodArray = explode(',', $deliverMethod);
}
}
}
unset($merchantCart, $cart);
$order_price = 0;
$total_true_price = 0;
@ -158,7 +140,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$order_svip_discount = 0;
// 循环计算每个店铺的订单数据 委托商品是否设置收货方式 ?
foreach ($merchantCartList as &$merchantCart) {
if (($order_type == 98 || $order_type == 99) && !empty($deliverMethodArray)) {
if ($order_type == 98 && !empty($deliverMethodArray)) {
$merchantCart['delivery_way'] = $deliverMethodArray;
}
$postageRule = [];