|
|
@@ -11594,6 +11594,8 @@ class StoreOrderRepository extends BaseRepository
|
|
11594
|
11594
|
$yanglaojin = 0.00;
|
|
11595
|
11595
|
$totalPrice = 0.00;
|
|
11596
|
11596
|
$totalNum = 0;
|
|
|
11597
|
+ // 记录每类商品 在此笔订单中的金额
|
|
|
11598
|
+ // 商品 => 此笔订单内此商品总价
|
|
11597
|
11599
|
$productPriceMap = [];
|
|
11598
|
11600
|
$validTotalPrice = 0.00;
|
|
11599
|
11601
|
$productCart = [];
|
|
|
@@ -11649,7 +11651,7 @@ class StoreOrderRepository extends BaseRepository
|
|
11649
|
11651
|
// 计算养老金
|
|
11650
|
11652
|
$yanglaojin = bcadd($yanglaojin, $productRepository->yanglaojin($cartEntity->getProductId()), 2);
|
|
11651
|
11653
|
|
|
11652
|
|
- // 验证是否是秒杀产品
|
|
|
11654
|
+ // 验证是否是秒杀产品 如果是秒杀产品,并且设置了 大仓会员价 则将大仓会员价 设置为 商品价格
|
|
11653
|
11655
|
if ($productEntity->getSeckill() == ProductEnum::SECKILL['Yes']['code'] && !is_null($productEntity->getDcPrice()) && $productEntity->getDcPrice() > 0.00) {
|
|
11654
|
11656
|
// 获取 在活动期间内的 秒杀活动记录
|
|
11655
|
11657
|
$seckillEntity = $seckillRepository->getSeckillEntityByProductId($cartEntity->getProductId());
|
|
|
@@ -11663,6 +11665,7 @@ class StoreOrderRepository extends BaseRepository
|
|
11663
|
11665
|
// type => '商品类型:1:普通商品。2:爆款商品。3:消费积分商品 。5:会员专享商品(城中大仓)6:每日免费领商品 7:商户特殊商品 8:共富会员商品 9:共富高级会员商品 10:高级会员商品 11村代理商品(废弃) 12镇代理商品(废弃) 13县代理商品(废弃) 14- 合伙人商品 15 股权商品 16合伙人+股权商品',
|
|
11664
|
11666
|
// ProductType => 0.普通商品 1.秒杀商品
|
|
11665
|
11667
|
$productEntity->setProductType($productEntity->getType());
|
|
|
11668
|
+
|
|
11666
|
11669
|
// 计算单价
|
|
11667
|
11670
|
$price = bcmul($cartEntity->getCartNum(), $productAttrValueEntity->getPrice(), 2);
|
|
11668
|
11671
|
// 计算总价
|
|
|
@@ -11776,14 +11779,43 @@ class StoreOrderRepository extends BaseRepository
|
|
11776
|
11779
|
|
|
11777
|
11780
|
|
|
11778
|
11781
|
$merchantMap[$cartEntity->getMerId()]['merchantEntity'] = $merchantEntity;
|
|
|
11782
|
+ $merchantMap[$cartEntity->getMerId()]['productIdListByCart'][] = $cartEntity->getProductId();
|
|
11779
|
11783
|
}
|
|
11780
|
11784
|
|
|
11781
|
11785
|
|
|
11782
|
11786
|
foreach ($merchantMap as $merId => $item) {
|
|
|
11787
|
+ // 当前商户的实体信息
|
|
11783
|
11788
|
/** @var MerchantEntity $merchantEntity */
|
|
11784
|
11789
|
$merchantEntity = $item['merchantEntity'];
|
|
11785
|
|
- // 计算优惠金额
|
|
|
11790
|
+ // 当前订单中 从当前商户中选择的商品列表
|
|
|
11791
|
+ $productIdListByCart = $item['productIdListByCart'];
|
|
|
11792
|
+
|
|
|
11793
|
+ // 查询 当前用户 在当前 店铺的 优惠券
|
|
11786
|
11794
|
$storeCouponUserEntityList = $storeCouponUserRepository->getValidStoreCouponUserEntityListByMerIdAndUid($merchantEntity->getMerId(), $userEntity->getUid());
|
|
|
11795
|
+ foreach ($storeCouponUserEntityList as $storeCouponUserEntity) {
|
|
|
11796
|
+ // 如果不能明确当前优惠券的 获取方式 ,则忽略当前的优惠券的有效性
|
|
|
11797
|
+ if (empty($storeCouponUserEntity->getType())) {
|
|
|
11798
|
+ continue;
|
|
|
11799
|
+ }
|
|
|
11800
|
+ // 优惠卷关联商品 辅助表
|
|
|
11801
|
+ $storeCouponProductEntityList = $storeCouponProductRepository->getStoreCouponProductEntityListByCouponId($storeCouponUserEntity->getCouponId());
|
|
|
11802
|
+
|
|
|
11803
|
+ foreach ($storeCouponProductEntityList as $storeCouponProductEntity) {
|
|
|
11804
|
+ // 如果当前 优惠券 所关联的 此 商品 不在当前购买的商品列表中,则说明此条关联记录 无用
|
|
|
11805
|
+ if (!in_array($storeCouponProductEntity->getProductId(), $productIdListByCart)) {
|
|
|
11806
|
+ continue;
|
|
|
11807
|
+ }
|
|
|
11808
|
+
|
|
|
11809
|
+ }
|
|
|
11810
|
+
|
|
|
11811
|
+ // 获取 当前消费者 有没有 从该商家发型的优惠券里 进行领取
|
|
|
11812
|
+ $couponCountByMerIdUid = $storeCouponRepository->validMerCouponExists($merchantEntity->getMerId(), $userEntity->getUid());
|
|
|
11813
|
+ if ($couponCountByMerIdUid > 0) {
|
|
|
11814
|
+
|
|
|
11815
|
+ }
|
|
|
11816
|
+
|
|
|
11817
|
+
|
|
|
11818
|
+ }
|
|
11787
|
11819
|
|
|
11788
|
11820
|
}
|
|
11789
|
11821
|
|