From 08fd149868ff70df43dae796be20763ff91db6be Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Jun 2017 23:54:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=BC=80=E5=90=AF=E4=B8=8D?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- app/models/shixun.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index cf40a5c07..882bc19e5 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -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 diff --git a/app/models/shixun.rb b/app/models/shixun.rb index 69beab432..af9cbe5da 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -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