实训开启不成功问题

This commit is contained in:
huang 2017-06-30 23:54:26 +08:00
parent 2d0a37e4b6
commit 08fd149868
2 changed files with 3 additions and 3 deletions

View File

@ -167,8 +167,8 @@ class ShixunsController < ApplicationController
logger.info("###################{res['code']}")
if res && res['code'].to_i == 0
logger.info("1111###################{res['code']}")
@shixun.update_attributes(:status => 1, :is_updated => 1)
apply = ApplyAction.where(:container_type => "ApplyShixun", :container_id => @shixun.id).last
@shixun.update_attributes(:status => 1)
apply = ApplyAction.where(:container_type => "ApplyShixun", :container_id => @shixun.id).order("created_at desc").first
if apply && apply.status == 0
@status = 0
else

View File

@ -7,7 +7,7 @@
#
class Shixun < ActiveRecord::Base
attr_accessible :description, :is_public, :name, :changeset_num, :status, :user_id, :gpid, :language, :identifier, :authentication,
:myshixun_count, :propaedeutics, :is_updated
:myshixun_count, :propaedeutics
has_many :users, :through => :shixun_members
has_many :shixun_members, :dependent => :destroy