fix coding style

This commit is contained in:
邱博亞 2023-06-04 22:28:32 +08:00
parent 4b2f23ca81
commit 2f3177ef3c
1 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,8 @@ class JournalsController < ApplicationController
params = OrbitHelper.params params = OrbitHelper.params
categories = [] categories = []
data = [] data = []
journals = Journal.order(created_at: :desc).filter_by_categories.filter_by_tags.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) journals = Journal.order(created_at: :desc).filter_by_categories.filter_by_tags
.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
ModuleApp.find_by(key: 'journal').categories.each do |e| ModuleApp.find_by(key: 'journal').categories.each do |e|
categories << [e.id.to_s, e.title] categories << [e.id.to_s, e.title]
end end
@ -71,7 +72,8 @@ class JournalsController < ApplicationController
def show_list def show_list
params = OrbitHelper.params params = OrbitHelper.params
journal = Journal.find_by(uid: params[:uid]) journal = Journal.find_by(uid: params[:uid])
chapters = Chapter.where(journal_id: journal.id).order(sort_number: :asc).page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) chapters = Chapter.where(journal_id: journal.id).order(sort_number: :asc)
.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
data = [] data = []
chapters.each do |node| chapters.each do |node|
data << { data << {