Commit 94b7d0c6 authored by liuyang's avatar liuyang

fixed bug:后台配置的推荐视频未生效

parent 445b7c4a
package com.qkdata.biz.management.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qkdata.biz.common.BizConstants;
import com.qkdata.biz.management.entity.RecommendConfigPO;
import com.qkdata.biz.management.service.CourseService;
......@@ -63,8 +65,15 @@ public class RecommendConfigController {
@RequiresRoles(value = {BizConstants.ROLE_ADMIN,BizConstants.ROLE_OPERATOR},logical = Logical.OR)
@SysLog("添加推荐")
public Result<String> add(@RequestBody List<RecommendConfigPO> list){
int sortNo = 0;
RecommendConfigPO recommendConfigPO = configService.getOne(Wrappers.<RecommendConfigPO>lambdaQuery().orderByDesc(RecommendConfigPO::getSortNo).last("limit 1"));
if (recommendConfigPO != null){
sortNo = recommendConfigPO.getSortNo() + 1;
}
for (RecommendConfigPO po : list){
po.setSortNo(sortNo);
configService.save(po);
sortNo++;
}
return Result.succeed("ok");
}
......
......@@ -94,7 +94,7 @@
WHERE c.is_del = 0
and c.`status` = 'UP'
and c.allow = 'ALL'
ORDER BY sort_no ASC,c.create_time DESC
ORDER BY sort_no ASC DESC
</select>
<select id="findListByTags" resultType="com.qkdata.biz.management.entity.CoursePO">
SELECT c.*
......
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