he2802 3 år sedan
förälder
incheckning
d15bd9c813

+ 2 - 2
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserBankRecordController.java

@@ -72,8 +72,8 @@ public class UserBankRecordController extends BaseController {
     /**
      * 新增用户的做题历史
      */
-    @ApiOperation("新增用户的做题历史")
-    @Log(title = "用户的做题历史", businessType = BusinessType.INSERT)
+    @ApiOperation("视频商品新增用户的做题历史")
+    @Log(title = "视频商品用户的做题历史", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody UserBankRecordAddBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());

+ 4 - 4
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -125,11 +125,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectExamList" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultMap="UserExamRecordVoResult">
         SELECT
             e.exam_id,
-            e.exam_name
+            e.exam_name,
+            uer.total_question_num
         FROM
-            exam e
-                LEFT JOIN ( SELECT exam_id FROM user_exam_record WHERE user_id = #{userId} AND goods_id = #{goodsId} GROUP BY exam_id ) uer ON e.exam_id = uer.exam_id
-
+            ( SELECT exam_id, MAX( total_question_num ) total_question_num FROM user_exam_record WHERE user_id = #{userId} AND goods_id = #{goodsId} GROUP BY exam_id ) uer
+                LEFT JOIN exam e ON e.exam_id = uer.exam_id
 
     </select>
 </mapper>