Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_unstable^2
杨树明 5 years ago
commit 807fa43d8e

@ -13,13 +13,8 @@ module SubjectsHelper
# 实训路径的所有用户获得的标签
def user_shixun_tags challenge_ids, user_id
logger.info("#####################")
ChallengeTag.joins("join games on challenge_tags.challenge_id = games.challenge_id").
where(challenge_id: challenge_ids, games: {status: 2, user_id: user_id}).pluck("challenge_tags.name").uniq
logger.info("#####################")
pass_challenge_ids = Game.where(status: 2, user_id: user_id, challenge_id: challenge_ids).pluck(:challenge_id)
ChallengeTag.where(challenge_id: pass_challenge_ids).pluck(:name).uniq
logger.info("#####################")
end
# 金课的课堂状态 0未开课1进行中2已结束

@ -82,16 +82,9 @@ class Subject < ApplicationRecord
end
def my_subject_progress
logger.info("#-----------")
my_challenge_count = Game.joins(:challenge).where(user_id: User.current.id, status: 2, challenges: {shixun_id: shixuns.published_closed}).
pluck(:challenge_id).uniq.size
logger.info("#-----------")
new_challenge_count = Challenge.left_joins(:games)
.where(games: {user_id: User.current.id, status: 2}, shixun_id: shixuns.published_closed)
.uniq.count
logger.info("#-----------")
subject_challenge_count = shixuns.sum(:challenges_count)
subject_challenge_count == 0 ? 0 : ((my_challenge_count.to_f / subject_challenge_count).round(2) * 100).to_i
pluck(:challenge_id).uniq.size
count = self.subject_challenge_count == 0 ? 0 : ((my_challenge_count.to_f / self.subject_challenge_count).round(2) * 100).to_i
end
def my_consume_time

@ -50,12 +50,11 @@ Rails.application.configure do
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = false
config.assets.debug = true
# Suppress logger output for asset requests.
config.assets.quiet = true
config.assets.compile = true
# config.assets.prefix = '/dev-assets'
# Raises error for missing translations

Loading…
Cancel
Save