|
|
|
@ -149,7 +149,10 @@ class ShixunsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
## 获取顶部菜单
|
|
|
|
|
def menus
|
|
|
|
|
@repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).order("updated_at asc")
|
|
|
|
|
@tag_repertoiry_ids = ShixunTagRepertoire.pluck(:tag_repertoire_id).uniq
|
|
|
|
|
@sub_repertoire_ids = TagRepertoire.where(id: @tag_repertoiry_ids).pluck(:sub_repertoire_id).uniq
|
|
|
|
|
repertoire_ids = SubRepertoire.where(id: @sub_repertoire_ids).pluck(:repertoire_id).uniq
|
|
|
|
|
@repertoires = Repertoire.includes(sub_repertoires: [:tag_repertoires]).where(id: repertoire_ids).order("updated_at asc")
|
|
|
|
|
# respond_with @repertoires
|
|
|
|
|
|
|
|
|
|
render_json
|
|
|
|
|