From 06266bc4fd7904a98a406c416e4491e775320839 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 29 Aug 2019 11:16:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discusses_controller.rb | 2 +- db/seeds.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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,