diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/community/CommunityPostHeatController.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/community/CommunityPostHeatController.java index d3fc87e..ecd531c 100644 --- a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/community/CommunityPostHeatController.java +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/community/CommunityPostHeatController.java @@ -39,11 +39,11 @@ public class CommunityPostHeatController extends BaseController */ @PreAuthorize("@ss.hasPermi('community:heat:list')") @GetMapping("/list") - public TableDataInfo list(CommunityPostHeat communityPostHeat) + public AjaxResult list(CommunityPostHeat communityPostHeat) { - startPage(); +// startPage(); List list = communityPostHeatService.selectCommunityPostHeatList(communityPostHeat); - return getDataTable(list); + return AjaxResult.success(list); } /** diff --git a/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostHeatServiceImpl.java b/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostHeatServiceImpl.java index ad1f94a..75ac33d 100644 --- a/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostHeatServiceImpl.java +++ b/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostHeatServiceImpl.java @@ -44,7 +44,7 @@ public class CommunityPostHeatServiceImpl implements ICommunityPostHeatService { //排序 List heatList = communityPostHeatMapper.selectCommunityPostHeatList(communityPostHeat); - heatList.stream().sorted((o1, o2) -> heatSortCalculate(o1).compareTo(heatSortCalculate(o2))).collect(Collectors.toList()); +// heatList.stream().sorted((o1, o2) -> heatSortCalculate(o1).compareTo(heatSortCalculate(o2))).collect(Collectors.toList()); return heatList; } diff --git a/inspur-service/inspur-community/src/main/resources/mapper/community/CommunityPostHeatMapper.xml b/inspur-service/inspur-community/src/main/resources/mapper/community/CommunityPostHeatMapper.xml index d732e2e..b8a6095 100644 --- a/inspur-service/inspur-community/src/main/resources/mapper/community/CommunityPostHeatMapper.xml +++ b/inspur-service/inspur-community/src/main/resources/mapper/community/CommunityPostHeatMapper.xml @@ -37,6 +37,8 @@ and post_id = #{postId} and likes = #{likes} and views = #{views} + order by 0.6 * a.replies + 0.4 * a.views desc + limit 5