zoujiajian 2 роки тому
батько
коміт
245e3d923f

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java

@@ -72,4 +72,6 @@ public interface GroupsRelationMapper extends BaseMapper<GroupsRelation> {
 	List<RenewalView> getUserHasPayGoods(@Param("list") List<Long> userIds, @Param("now") DateTime now);
 
 	Long getExperienceTicket(@Param("userId") Long userId, @Param("skuId") Long skuId);
+
+	Long selectGoodsDonQaByGoodsId(Long goodsId);
 }

+ 9 - 0
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -354,4 +354,13 @@
                  inner join groups_trips gt on gt.id = gr.groups_id
         where gt.sku_id = #{skuId} limit 1
     </select>
+
+    <select id="selectGoodsDonQaByGoodsId" resultType="java.lang.Long">
+        select count(1)
+        from (select question_id from goods_don_qa_relate where goods_id = #{goodsId} and deleted is true) s
+                 inner join goods_don_qa qa on qa.id = s.question_id
+        where qa.type = 2
+          and qa.status is true
+          and qa.deleted is true
+    </select>
 </mapper>

+ 2 - 4
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -291,10 +291,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				Integer codeNum = getUserCodeNumBySkuId(ticket.getUserId(), ticket.getSkuId(), isHasVerifyCode);
 				ticket.setCodeNum(codeNum);
 			}
-			Integer qa = goodsDonQaRelateMapper.selectCount(Wrappers.lambdaQuery(GoodsDonQaRelate.class)
-					.eq(GoodsDonQaRelate::getGoodsId, ticket.getGoodsId())
-					.eq(GoodsDonQaRelate::getDeleted, 1));
-			ticket.setQa(qa > 0 ? true : false);
+			Long qaId = groupsRelationMapper.selectGoodsDonQaByGoodsId(ticket.getGoodsId());
+			ticket.setQa(qaId > 0 ? true : false);
 		});
 		userLoginRecordService.saveUserLoginDayRecord(userId);
 		return list;