|
|
@ -756,7 +756,7 @@ class ShixunsController < ApplicationController
|
|
|
|
def apply_public
|
|
|
|
def apply_public
|
|
|
|
tip_exception(-1, "请先发布实训再申请公开") if @shixun.status != 2
|
|
|
|
tip_exception(-1, "请先发布实训再申请公开") if @shixun.status != 2
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
@shixun.update_attributes!(pubic: 1)
|
|
|
|
@shixun.update_attributes!(public: 1)
|
|
|
|
apply = ApplyAction.where(:container_type => "ApplyShixun", :container_id => @shixun.id).order("created_at desc").first
|
|
|
|
apply = ApplyAction.where(:container_type => "ApplyShixun", :container_id => @shixun.id).order("created_at desc").first
|
|
|
|
if apply && apply.status == 0
|
|
|
|
if apply && apply.status == 0
|
|
|
|
@status = 0
|
|
|
|
@status = 0
|
|
|
|