فهرست منبع

update findSuggestKeyword method in SearchRecordMapper.xml

reghao 7 ماه پیش
والد
کامیت
4ab76f8ba8
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      content/content-service/src/main/resources/mapper/vod/SearchRecordMapper.xml

+ 3 - 1
content/content-service/src/main/resources/mapper/vod/SearchRecordMapper.xml

@@ -17,9 +17,11 @@
         limit 10
     </select>
     <select id="findSuggestKeyword" resultType="cn.reghao.tnb.content.app.vod.model.vo.SuggestKeyword">
-        select id as `rank`,keyword
+        select id as `rank`,keyword,count(*) as total
         from vod_search_record
         where keyword like concat('%',#{keyword},'%')
+        group by keyword
+        order by total desc
         limit 5
     </select>
 </mapper>