dev_hjm_a
daiao 5 years ago
parent 489e32b350
commit f97277cb28

@ -5,7 +5,7 @@ class MirrorRepository < ApplicationRecord
scope :published_mirror, -> { where(status: 1) }
scope :published_mirror, -> { where(status: [0,1]) }
scope :published_main_mirror, -> { published_mirror.where(main_type: 1) }
scope :published_small_mirror, -> { published_mirror.where(main_type: 0) }

@ -129,7 +129,7 @@ class Shixun < ApplicationRecord
end
def main_mirror_id
mirror_repositories.where(main_type: 1).first.try(:id) || -1
mirror_repositories.published_main_mirror.first.try(:id) || -1
end
# 实训对应的镜像小类别名(已选)

Loading…
Cancel
Save