zoujiajian 2 年 前
コミット
b896117cdf

+ 7 - 0
netflix-web/src/main/java/com/cyksj/web/controller/user/UserController.java

@@ -469,19 +469,26 @@ public class UserController {
                             .eq(UserPlatSkuDistributeRate::getDistributeId, userDistribute.getId())
                             .eq(UserPlatSkuDistributeRate::getGoodsId, e.getGoodsId())
                             .ne(UserPlatSkuDistributeRate::getRate, 0)
+                            //上架
+                            .apply("exists (select 1 from goods_don_sku sku where sku.id = sku_id and sku.status is true limit 1)")
                             .orderByAsc(UserPlatSkuDistributeRate::getRate)
                             .last("limit 1"));
                     if (userPlatSkuDistributeRate != null) {
                         e.setRate(userPlatSkuDistributeRate.getRate());
+                        GoodsDonSku sku = skuMapper.selectById(userPlatSkuDistributeRate.getSkuId());
+                        e.setPrice(sku.getPrice());
                     }
                 } else {
                     DistributeGeneralSkuRate distributeGeneralSkuRate = distributeGeneralSkuRateMapper.selectOne(Wrappers.lambdaQuery(DistributeGeneralSkuRate.class)
                             .eq(DistributeGeneralSkuRate::getGoodsId, e.getGoodsId())
+                            .apply("exists (select 1 from goods_don_sku sku where sku.id = sku_id and sku.status is true limit 1)")
                             .ne(DistributeGeneralSkuRate::getRate, 0)
                             .orderByAsc(DistributeGeneralSkuRate::getRate)
                             .last("limit 1"));
                     if (distributeGeneralSkuRate != null) {
                         e.setRate(distributeGeneralSkuRate.getRate());
+                        GoodsDonSku sku = skuMapper.selectById(distributeGeneralSkuRate.getSkuId());
+                        e.setPrice(sku.getPrice());
                     }
                 }
             }