he2802 1 vuosi sitten
vanhempi
commit
f742e18f3b

+ 1 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -609,7 +609,6 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
 
             Long secLong = 0L;
             Long studyLong = 0L;
-            Integer studyStatus = 0;
             SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
             subjectStudyRecordQueryBo.setGoodsId(goodsVo.getGoodsId());
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
@@ -625,11 +624,10 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
             if (ObjectUtils.isNotNull(vo)){
                 secLong = vo.getSectionNum();
                 studyLong = vo.getRecordNum();
-                studyStatus = studyStatus + vo.getStudyStatus().intValue();
             }
             goodsVo.setSecAllNum(secLong);
             goodsVo.setStuAllNum(studyLong);
-            if(studyStatus>0){
+            if(vo.getStudyStatus()>0){
                 goodsVo.setStudyStatus(2);
             }else{
                 goodsVo.setStudyStatus(1);

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -118,6 +118,7 @@
         <result property="sevenYear" column="seven_year"/>
         <result property="orderYear" column="order_year"/>
         <result property="sevenClassCopy" column="seven_class_copy"/>
+        <result property="studyStatus" column="study_status"/>
     </resultMap>
 
     <select id="selectListBybo" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsQueryBo"
@@ -497,7 +498,8 @@
         us.apply_site_end_time as sub_apply_site_end_time,
         us.apply_site_exam_time as sub_apply_site_exam_time,
         (SELECT COUNT(1) FROM goods_course gc where gc.goods_id = g.goods_id) as course_num,
-        og.study_count as user_study_count
+        og.study_count as user_study_count,
+        (SELECT count(*) from user_study_record usr where usr.user_id = o.user_id and usr.order_goods_id = og.order_goods_id) as study_status
         FROM
         order_goods og
         LEFT JOIN goods g on g.goods_id =og.goods_id