| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.OrderActivityInfo; |
| | | import com.ruoyi.other.service.OrderActivityInfoService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/order-activity-info") |
| | | public class OrderActivityInfoController { |
| | | |
| | | @Resource |
| | | private OrderActivityInfoService orderActivityInfoService; |
| | | |
| | | |
| | | /** |
| | | * 获取当前生效的活动 |
| | | * @param vip |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getNowOrderActivityInfo") |
| | | public R<OrderActivityInfo> getNowOrderActivityInfo(@RequestParam("vip") Integer vip){ |
| | | OrderActivityInfo one = orderActivityInfoService.getOne(new LambdaQueryWrapper<OrderActivityInfo>().eq(OrderActivityInfo::getDelFlag, 0) |
| | | .last(" and now() between start_time and end_time and FIND_IN_SET(" + vip + ", vip_ids) limit 0, 1")); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | } |
| | | |