diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb index 6ddf71ba4..1b7147863 100644 --- a/app/controllers/discusses_controller.rb +++ b/app/controllers/discusses_controller.rb @@ -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) diff --git a/db/seeds.rb b/db/seeds.rb index 82f2b5316..d7c2478d9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -17,6 +17,7 @@ user_params = [ admin: 1, status: 1, language: 'zh', + nickname: 'Educoder', show_realname: '社区导师', professional_certification: 1, certification: 1,