diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 08ca3ff77..5f5eddddc 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -166,12 +166,12 @@ class HackUserLastestCodesController < ApplicationController # 通关 if submit_params[:status] == "0" # 编程题已经发布,且之前未通关奖励积分 + @hack.increment!(:pass_num) if @hack.status == 1 && !@my_hack.passed? reward_attrs = { container_id: game.id, container_type: 'Hack', score: @hack.score } RewardGradeService.call(@my_hack.user, reward_attrs) RewardExperienceService.call(@my_hack.user, reward_attrs) # 评测完成更新通过数 - @hack.increment!(:pass_num) @my_hack.update_attributes(passed: true, passed_time: Time.now) end end