Browse Source

fix 错题

he2802 3 years ago
parent
commit
326ca2fc32

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -256,7 +256,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 }
 
             }
-            if(!canRepeatBuy){
+            if(!canRepeatBuy&&goods.getGoodsType()!=3&&goods.getGoodsType()!=4){
                 this.checkBuyGoods(g.getGoodsId(),bo.getUserId());
             }
         }
@@ -343,7 +343,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                     redisCache.unlockLua(redisLockEntity);
                 }
             }
-            if(!canRepeatBuy){
+            if(!canRepeatBuy&&goods.getGoodsType()!=3&&goods.getGoodsType()!=4){
                 this.checkBuyGoods(g.getGoodsId(),bo.getUserId());
             }
             iShoppingCartService.deleteByGoodsId(g.getGoodsId(),bo.getUserId());

+ 11 - 2
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamWrongRecordMapper.xml

@@ -136,10 +136,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="recordNum" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo"  resultType="Long">
         SELECT
-        count( DISTINCT question_id )
+        SUM( uewr.num )
+        FROM
+        (
+        SELECT
+        exam_id,
+        count( DISTINCT question_id ) AS num
         FROM
         user_exam_wrong_record
-        WHERE 1=1
+        WHERE
+        1 = 1
         <if test="goodsId != null and goodsId != ''">
         AND goods_id = #{goodsId}
         </if>
@@ -147,5 +153,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="recordId != null and recordId != ''">
             AND record_id = #{recordId}
         </if>
+        GROUP BY
+        exam_id
+        ) uewr
     </select>
 </mapper>