|
|
|
@ -64,7 +64,7 @@ class DiscussesController < ApplicationController
|
|
|
|
|
# on s.id = str.shixun_id) on tr.id = str.tag_repertoire_id
|
|
|
|
|
# group by d.dis_id order by cnt desc) a limit 9").map{|ht| ht.attributes.dup}
|
|
|
|
|
tag_id = ShixunTagRepertoire.joins(:shixun).order("myshixuns_count desc").pluck(:tag_repertoire_id).uniq.first(9)
|
|
|
|
|
@hot_tags = TagRepertoire.select([:id, :name]).where(id: tag_id).order("FIELD(id, #{tag_id.join(",")})").map{|ht| ht.attributes.dup} if tag_id
|
|
|
|
|
@hot_tags = TagRepertoire.select([:id, :name]).where(id: tag_id).order("FIELD(id, #{tag_id.join(",")})").map{|ht| ht.attributes.dup} if tag_id.present?
|
|
|
|
|
|
|
|
|
|
@memos = DiscussesService.new.memo_list @memos
|
|
|
|
|
@hot_memos = Memo.field_for_recommend.posts.hot.includes(:tag_repertoires).limit(4)
|
|
|
|
|