Browse Source

竞赛配置子赛项

pull/313/head
xiaoxiaoqiong 4 years ago
parent
commit
6e86f9d9f3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/controllers/settings_controller.rb

+ 2
- 2
app/controllers/settings_controller.rb View File

@@ -33,8 +33,8 @@ class SettingsController < ApplicationController
def get_sub_competitions
@sub_competitions = []
Site.competition.pluck(:key).uniq.each do |key|
hash = {}
hash.merge!("#{key.to_s}": Site.competition.where(key: key).select(:id, :name, :url, :key).to_a.map(&:serializable_hash))
hash = {"identifier": "#{key.to_s}"}
hash.merge!("list": Site.competition.where(key: key).select(:id, :name, :url, :key).to_a.map(&:serializable_hash))
@sub_competitions << hash
end
end


Loading…
Cancel
Save