修改店铺券使用
This commit is contained in:
parent
1b6b2709a1
commit
aac0774b9c
@ -87,6 +87,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
// 循环计算每个店铺的订单数据
|
||||
/** @var StoreCouponUserRepository $userCouponRepo */
|
||||
$userCouponRepo = app()->make(StoreCouponUserRepository::class);
|
||||
$cartCoupon = []; //购物车各商品的优惠券信息
|
||||
foreach ($merchantCartList as &$merchantCart) {
|
||||
$isPlatformCard = $userCouponRepo->checkBuyLimit($merchantCart['list'], $uid);
|
||||
$postageRule = [];
|
||||
@ -381,7 +382,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
unset($coupon);
|
||||
$pay_price = max(bcsub($valid_total_price, $coupon_price, 2), 0);
|
||||
$_pay_price = $pay_price;
|
||||
$cartCoupon = []; //购物车各商品的优惠券信息
|
||||
$userUsedCoupon = []; //用户优惠券使用信息,用于下单时扣除优惠券余额
|
||||
//计算店铺券
|
||||
foreach ($merchantCart['coupon'] as &$coupon) {
|
||||
@ -711,6 +711,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
$_price = bcadd($couponPrice, $_price, 2);
|
||||
}
|
||||
unset($cart);
|
||||
$merchantCart['order']['platform_coupon_id'] = $platformCouponRate['id'];
|
||||
$merchantCart['order']['platform_coupon_price'] = $_price;
|
||||
$merchantCart['order']['true_price'] = bcsub($merchantCart['order']['true_price'], $_price, 2);
|
||||
$total_platform_coupon_price = bcadd($total_platform_coupon_price, $_price, 2);
|
||||
@ -1143,6 +1144,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
'coupon_id' => implode(',', $merchantCart['order']['useCouponIds']),
|
||||
'mark' => $mark[$merchantCart['mer_id']] ?? '',
|
||||
'coupon_price' => $couponPrice_order,
|
||||
'platform_coupon_id' => $orderInfo['platform_coupon_id'],
|
||||
'platform_coupon_price' => $merchantCart['order']['platform_coupon_price'],
|
||||
'pay_type' => $pay_type,
|
||||
'refund_switch' => $merchantCart['order']['order_refund_switch'],
|
||||
|
@ -2678,7 +2678,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
->where($where)
|
||||
->field('a.value_id,a.product_id,a.mer_id,a.sku,a.stock,a.image,a.price,
|
||||
a.svip_price,
|
||||
a.unique,p.store_name,p.store_info');
|
||||
a.unique,p.store_name,p.store_info,p.image as product_image');
|
||||
$query2 = clone $query;
|
||||
$list1 = $query->where('a.price', '>', $money)->order('a.price', 'asc')->limit(5)->select()->toArray();
|
||||
$list2 = $query2->where('a.price', '<=', $money)->order('a.price', 'desc')->limit(5)->select()->toArray();
|
||||
@ -2762,6 +2762,9 @@ class StoreOrderRepository extends BaseRepository
|
||||
$countRange3 = 0;
|
||||
|
||||
foreach ($originalArray as $item) {
|
||||
if (empty($item['image'])) {
|
||||
$item['image'] = $item['product_image'];
|
||||
}
|
||||
$price = floatval($item['price']);
|
||||
if ($price >= 0 && $price <= 100) {
|
||||
$range1[] = $item;
|
||||
|
Loading…
x
Reference in New Issue
Block a user