he2802 2 年之前
父节点
当前提交
b4fd040e55

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -431,11 +431,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             throw new CustomException("参数错误");
         }
         if (Validator.isEmpty(bo.getOrderGoodsId())) {
-            throw new CustomException("参数错误");
+            throw new CustomException("OrderGoods参数错误");
         }
         ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
         queryBo.setGradeId(bo.getGradeId());
         queryBo.setUserId(bo.getUserId());
+        queryBo.setOrderGoodsId(bo.getOrderGoodsId());
         ClassPeriodStudentVo classPeriodStudentVo = baseMapper.userPeriodStatus(queryBo);
         Long secLong = 0L;
         Long studyLong = 0L;

+ 4 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -785,7 +785,7 @@
         g.study_start_time,
         g.study_end_time,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
-        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.`type` in (1,3) and ubr.grade_id = cg.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
+        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.`type` in (1,3) and ubr.grade_id = cg.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
         cgu.user_id,
         cgg.goods_id
         FROM
@@ -812,6 +812,9 @@
         <if test="userId != null ">
             and cgu.user_id = #{userId}
         </if>
+        <if test="orderGoodsId != null ">
+            and cgu.order_goods_id = #{orderGoodsId}
+        </if>
         LIMIT 1
     </select>