讨论区报错

dev_local_2
daiao 5 years ago
parent 1c07a0e9d3
commit 06266bc4fd

@ -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)

@ -17,6 +17,7 @@ user_params = [
admin: 1,
status: 1,
language: 'zh',
nickname: 'Educoder',
show_realname: '社区导师',
professional_certification: 1,
certification: 1,

Loading…
Cancel
Save