多余参数移除
This commit is contained in:
@@ -192,17 +192,19 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
|||||||
|
|
||||||
PageHelper.startPage(page, limit);
|
PageHelper.startPage(page, limit);
|
||||||
if (admin == null) {
|
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);
|
sort, startTime, endTime, userId, isPrice, over, wxCourse, dyCourse, wxShow, dyShow);
|
||||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(map);
|
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(map);
|
||||||
List<Map<String, Object>> records = pageInfo.getList();
|
List<Map<String, Object>> records = pageInfo.getList();
|
||||||
for (Map<String, Object> m : records) {
|
for (Map<String, Object> m : records) {
|
||||||
Integer i = courseDetailsDao.selectCount(new QueryWrapper<CourseDetails>().eq("course_id", m.get("courseId")));
|
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("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());
|
m.put("courseId", m.get("courseId").toString());
|
||||||
}
|
}
|
||||||
PageUtils pageUtils = PageUtils.page(pageInfo);
|
PageUtils pageUtils = PageUtils.page(pageInfo);
|
||||||
@@ -222,10 +224,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
|||||||
Map<String, Object> countMap = courseDetailsDao.countCourse(courseId);
|
Map<String, Object> countMap = courseDetailsDao.countCourse(courseId);
|
||||||
BigDecimal payMoney = ordersDao.sumPayByCourseId(courseId);
|
BigDecimal payMoney = ordersDao.sumPayByCourseId(courseId);
|
||||||
map.put("payMoney", payMoney == null ? BigDecimal.ZERO : payMoney);
|
map.put("payMoney", payMoney == null ? BigDecimal.ZERO : payMoney);
|
||||||
map.put("courseDetailsId", null);
|
// map.put("courseDetailsId", null);
|
||||||
map.put("courseDetailsName", "");
|
// map.put("courseDetailsName", "");
|
||||||
map.put("dyEpisodeId", "");
|
// map.put("dyEpisodeId", "");
|
||||||
map.put("wxCourseDetailsId", "");
|
// map.put("wxCourseDetailsId", "");
|
||||||
map.putAll(countMap);
|
map.putAll(countMap);
|
||||||
map.put("courseId", map.get("courseId").toString());
|
map.put("courseId", map.get("courseId").toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,41 +11,17 @@
|
|||||||
c.classify_id AS classifyId,
|
c.classify_id AS classifyId,
|
||||||
c.course_id AS courseId,
|
c.course_id AS courseId,
|
||||||
c.course_label AS courseLabel,
|
c.course_label AS courseLabel,
|
||||||
c.create_time AS createTime,
|
|
||||||
c.details,
|
c.details,
|
||||||
c.img,
|
c.img,
|
||||||
c.banner_img AS bannerImg,
|
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.is_over AS isOver,
|
||||||
c.title,
|
c.title,
|
||||||
c.is_price AS isPrice,
|
|
||||||
c.title_img AS titleImg,
|
c.title_img AS titleImg,
|
||||||
c.update_time AS updateTime,
|
|
||||||
c.course_type AS courseType,
|
c.course_type AS courseType,
|
||||||
c.banner_id AS bannerId
|
|
||||||
FROM
|
FROM
|
||||||
course AS c
|
course AS c
|
||||||
WHERE
|
WHERE
|
||||||
c.is_delete = 0
|
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'>
|
<if test='null != title'>
|
||||||
and c.title LIKE CONCAT('%', #{title}, '%')
|
and c.title LIKE CONCAT('%', #{title}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -67,15 +43,6 @@
|
|||||||
<if test="status!=null and status!=0">
|
<if test="status!=null and status!=0">
|
||||||
and c.status=#{status}
|
and c.status=#{status}
|
||||||
</if>
|
</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">
|
<if test="sort==null">
|
||||||
order by c.sort asc,c.create_time desc
|
order by c.sort asc,c.create_time desc
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user