红包抽奖次数提示
This commit is contained in:
@@ -46,6 +46,13 @@ public class AppCourseController extends AbstractController {
|
||||
return courseDetailsService.selectCourseDetailsById(id, token, courseDetailsId);
|
||||
}
|
||||
|
||||
@Login
|
||||
@GetMapping("/getRedEnvelopeTips")
|
||||
@ApiOperation("获取抽奖红包提示")
|
||||
public Result getRedEnvelopeTips(@RequestAttribute("userId") Long userId) {
|
||||
return courseService.getRedEnvelopeTips(userId);
|
||||
}
|
||||
|
||||
@GetMapping("/selectCourseDetailsList")
|
||||
@ApiOperation("查询推荐视频")
|
||||
public Result selectCourseDetailsList(Integer page, Integer limit, String token, String randomNum, Integer wxShow, Integer dyShow) {
|
||||
|
||||
@@ -61,4 +61,6 @@ public interface CourseService extends IService<Course> {
|
||||
|
||||
Result viewCourse(Long userId, Long courseId, Long courseDetailsId, String type);
|
||||
|
||||
Result getRedEnvelopeTips(Long userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sqx.modules.course.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -1258,4 +1259,16 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, Course> implements
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getRedEnvelopeTips(Long userId) {
|
||||
// 查询 用户 购买次数
|
||||
Integer count = ordersService.countOrderNum(userId, DateUtil.formatTime(DateUtil.beginOfDay(new Date())));
|
||||
|
||||
String totalCount = commonInfoService.findOne(901).getValue();
|
||||
|
||||
String data = String.format("每日前%s次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第%d次付款", totalCount, count + 1);
|
||||
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user