v1.1: 转赠钻石返回排序调整

This commit is contained in:
lzm
2022-10-22 13:59:18 +08:00
parent 91bb4fe461
commit 766ab910b1
2 changed files with 4 additions and 5 deletions

View File

@@ -31,8 +31,9 @@
u.avatar as targetAvatar
from diamond_give_history dgh
left join users u on dgh.to_uid = u.uid
where dgh.create_time >= #{date} and dgh.from_uid = #{uid}
group by dgh.from_uid, dgh.to_uid
where dgh.id in(select max(id) from diamond_give_history
where create_time >= #{date} and from_uid = #{uid}
group by from_uid, to_uid)
order by dgh.create_time desc
</select>

View File

@@ -1,11 +1,9 @@
package com.accompany.business.controller.user;
import com.accompany.business.common.BaseController;
import com.accompany.business.dto.UserCpRecordDto;
import com.accompany.business.service.purse.DiamondGiveHistoryService;
import com.accompany.common.result.BusiResult;
import com.accompany.common.status.BusiStatus;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,7 +28,7 @@ public class DiamondGiveHistoryController extends BaseController {
@ApiOperation("用户转赠记录")
@GetMapping("/giveRecord")
public BusiResult<List<UserCpRecordDto>> list(@RequestParam(defaultValue = "1")Integer pageNum, @RequestParam(defaultValue = "20")Integer pageSize) {
public BusiResult list(@RequestParam(defaultValue = "1")Integer pageNum, @RequestParam(defaultValue = "20")Integer pageSize) {
return new BusiResult(diamondGiveHistoryService.getRecordVos(this.getUid(),pageNum,pageSize));
}