Ver código fonte

update findSuggestKeyword method in SearchRecordMapper.xml

reghao 7 meses atrás
pai
commit
4ab76f8ba8

+ 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>