多余参数移除

This commit is contained in:
wangw 2025-01-09 18:20:53 +08:00
parent 63c1862a2b
commit d9208a5228
2 changed files with 11 additions and 42 deletions

View File

@ -192,17 +192,19 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
PageHelper.startPage(page, limit);
if (admin == null) {
List<Map<String, Object>> map = baseMapper.selectCourse(classifyId, title, isRecommend, status, bannerId,
List<Map<String, Object>> map = baseMapper.selectCourse(classifyId, title, isRecommend, 1, bannerId,
sort, startTime, endTime, userId, isPrice, over, wxCourse, dyCourse, wxShow, dyShow);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(map);
List<Map<String, Object>> records = pageInfo.getList();
for (Map<String, Object> m : records) {
Integer i = courseDetailsDao.selectCount(new QueryWrapper<CourseDetails>().eq("course_id", m.get("courseId")));
if (i != null && i.equals(0)) {
baseMapper.update(null, new LambdaUpdateWrapper<Course>()
.eq(Course::getCourseId, m.get("courseId"))
.set(Course::getUpdateTime, DateUtil.now())
.set(Course::getStatus, 2));
}
m.put("courseDetailsCount", i == null ? 0 : i);
m.put("courseDetailsId", null);
m.put("courseDetailsName", "");
m.put("dyEpisodeId", "");
m.put("wxCourseDetailsId", "");
m.put("courseId", m.get("courseId").toString());
}
PageUtils pageUtils = PageUtils.page(pageInfo);
@ -222,10 +224,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
Map<String, Object> countMap = courseDetailsDao.countCourse(courseId);
BigDecimal payMoney = ordersDao.sumPayByCourseId(courseId);
map.put("payMoney", payMoney == null ? BigDecimal.ZERO : payMoney);
map.put("courseDetailsId", null);
map.put("courseDetailsName", "");
map.put("dyEpisodeId", "");
map.put("wxCourseDetailsId", "");
// map.put("courseDetailsId", null);
// map.put("courseDetailsName", "");
// map.put("dyEpisodeId", "");
// map.put("wxCourseDetailsId", "");
map.putAll(countMap);
map.put("courseId", map.get("courseId").toString());
}

View File

@ -11,41 +11,17 @@
c.classify_id AS classifyId,
c.course_id AS courseId,
c.course_label AS courseLabel,
c.create_time AS createTime,
c.details,
c.img,
c.banner_img AS bannerImg,
c.status,
c.is_delete AS isDelete,
c.msg_type AS msgType,
c.msg_url AS msgUrl,
c.pay_num AS payNum,
c.price,
c.wholesale_price AS wholesalePrice,
c.is_over AS isOver,
c.title,
c.is_price AS isPrice,
c.title_img AS titleImg,
c.update_time AS updateTime,
c.course_type AS courseType,
c.banner_id AS bannerId
FROM
course AS c
WHERE
c.is_delete = 0
<if test='null != wxShow and wxShow==1'>
and c.wx_show = #{wxShow}
</if>
<if test='null != wxShow and wxShow==2'>
and (c.wx_show = #{wxShow} or c.wx_show is null)
</if>
<if test='null != dyShow and dyShow==1'>
and c.dy_show = #{dyShow}
</if>
<if test='null != dyShow and dyShow==2'>
and (c.dy_show = #{dyShow} or c.dy_show is null)
</if>
<if test='null != title'>
and c.title LIKE CONCAT('%', #{title}, '%')
</if>
@ -67,15 +43,6 @@
<if test="status!=null and status!=0">
and c.status=#{status}
</if>
<if test="isPrice!=null">
and c.is_price=#{isPrice}
</if>
<if test="wxCourse!=null">
and c.wx_course_id is not null
</if>
<if test="dyCourse!=null">
and c.dy_status=4
</if>
<if test="sort==null">
order by c.sort asc,c.create_time desc
</if>