Commit b97b5d95 by 梅存智

项目列表增加统计人数

parent 4aed6792
...@@ -202,6 +202,15 @@ public class TrainingProjectVo extends Model<TrainingProjectVo> { ...@@ -202,6 +202,15 @@ public class TrainingProjectVo extends Model<TrainingProjectVo> {
@ApiModelProperty(value = "上传图片") @ApiModelProperty(value = "上传图片")
private List<TrainingProjectDetailsImageVO> detailsImage; private List<TrainingProjectDetailsImageVO> detailsImage;
@ApiModelProperty(value = "报名人数")
private String enrollCount;
@ApiModelProperty(value = "签到人数")
private String signCount;
@ApiModelProperty(value = "评论人数")
private String commentCount;
@Override @Override
protected Serializable pkVal() { protected Serializable pkVal() {
return this.id; return this.id;
......
...@@ -130,9 +130,15 @@ ...@@ -130,9 +130,15 @@
tp.enable_queue as enableQueue, tp.enable_queue as enableQueue,
enroll.actual_price as actualPrice, enroll.actual_price as actualPrice,
enroll.original_price as originalPrice, enroll.original_price as originalPrice,
enroll.enable_pay as enablePay enroll.enable_pay as enablePay,
COUNT(DISTINCT enr.account_id) AS enrollCount,
COUNT(DISTINCT sre.account_id) AS signCount,
COUNT(DISTINCT comm.create_by_id) AS commentCount
FROM training_project tp FROM training_project tp
left join tr_enroll enroll on tp.id = enroll.training_project_id left join tr_enroll enroll on tp.id = enroll.training_project_id
left join tp_student_enroll_passed enr on tp.id=enr.training_project_id
left join tr_sign_record sre on tp.id=sre.training_project_id
left join tp_comment comm on tp.id=comm.training_project_id AND comm.biz_type=1
<where> <where>
tp.deleted = 0 tp.deleted = 0
<if test="enableEnroll != null"> <if test="enableEnroll != null">
...@@ -159,6 +165,7 @@ ...@@ -159,6 +165,7 @@
</if> </if>
</where> </where>
GROUP BY tp.id
ORDER BY tp.`create_time` DESC ORDER BY tp.`create_time` DESC
</select> </select>
......
...@@ -800,12 +800,15 @@ public class TrainingProjectServiceImpl extends ServiceImpl<TrainingProjectMappe ...@@ -800,12 +800,15 @@ public class TrainingProjectServiceImpl extends ServiceImpl<TrainingProjectMappe
addViewRecord(accountId, context, project, now); addViewRecord(accountId, context, project, now);
//获取投票ID和名称 //获取投票ID和名称
if(project.getResearchId() != null){ TpPlanActivity tpPlanActivity = new TpPlanActivity();
ResearchVo researchVo = researchClient.viewInfo(project.getResearchId()); tpPlanActivity.setDeleted(0);
if(researchVo != null){ tpPlanActivity.setType(2);
introductionVo.setResearchId(researchVo.getId()); tpPlanActivity.setTrainingProjectId(trainingProjectId);
introductionVo.setResearchName(researchVo.getName()); EntityWrapper<TpPlanActivity> wrapper = new EntityWrapper<TpPlanActivity>(tpPlanActivity);
} List<TpPlanActivity> planActivitys = tpPlanActivityMapper.selectList(wrapper);
if (!CollectionUtils.isEmpty(planActivitys)){
introductionVo.setResearchId(planActivitys.get(0).getRelationId());
introductionVo.setResearchName(planActivitys.get(0).getName());
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment