Browse Source

fix 前培

he2802 3 years ago
parent
commit
47540e2fcb

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserSubscribeMapper.xml

@@ -97,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="canBefore != null and canBefore == 1 ">
             and us.subscribe_status = 1
             and us.exam_status = 0
+            and (SELECT count(*) from exam_before_goods ebg where ebg.before_id = #{beforeId} and ebg.goods_id = us.goods_id) >0
             and (us.before_status = 1 or (SELECT count(*) from user_exam_goods ueg where ueg.user_id = us.user_id and ueg.goods_id = us.goods_id and ueg.do_number - ueg.expend_before>0)>0)
         </if>
         <if test="canExam != null and canExam == 1 ">
@@ -141,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           <if test="beforeExpend != null ">
             and us.before_expend is NOT NULL
         </if>
-          <if test="beforeId != null ">
+          <if test="beforeId != null and canBefore == null">
             and us.before_id =#{beforeId}
         </if>
         <if test="exceedExamExpend != null and exceedExamExpend == 1">