超级管理员的待审批申请中,更改申请高校名称后,依然在待审批消息中显示
This commit is contained in:
parent
83e4a44062
commit
90f0dc47b8
|
@ -756,7 +756,7 @@ class AdminController < ApplicationController
|
|||
|
||||
# 单位审核:批准
|
||||
# 消息发送,发送对象为申请人
|
||||
# status: 0表示未批准; status:1表示已批准; status: 2表示已更改; status: 3表示已拒绝;
|
||||
# status: 0表示未批准; status:1表示已批准; status: 2表示已更改; status: 3表示已拒绝; status: 4表示已更改后废除的高校
|
||||
def approve_applied_schools
|
||||
applied_school = ApplyAddSchools.find params[:id]
|
||||
applied_message_id = applied_school.school_id
|
||||
|
@ -783,8 +783,8 @@ class AdminController < ApplicationController
|
|||
begin
|
||||
#更新消息表的status
|
||||
applied_message_id = aas.school_id
|
||||
#applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools")
|
||||
#applied_message.update_all(:status => 2)
|
||||
applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools")
|
||||
applied_message.update_all(:status => 4)
|
||||
aas.update_attribute(:status, 2)
|
||||
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
|
||||
users = UserExtensions.where("school_id = #{aas.school_id}")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!-- 申请添加单位 -->
|
||||
<% if ma.applied_type == "ApplyAddSchools" %>
|
||||
<% if ma.applied_type == "ApplyAddSchools" && ma.status != 4 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<div class="longMessageWidth">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
<%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
|
||||
<% elsif ma.status == 0 %>
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
|
||||
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
|
||||
<%= link_to "“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
|
||||
</a>
|
||||
<% end %>
|
|
@ -0,0 +1,8 @@
|
|||
class UpdateStatusForAppliedMessages < ActiveRecord::Migration
|
||||
def up
|
||||
AppliedMessage.where(:applied_type => "ApplyAddSchools", :status => 0).update_all(:status => 4)
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
59
db/schema.rb
59
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20170219070127) do
|
||||
ActiveRecord::Schema.define(:version => 20170303030731) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -1064,12 +1064,39 @@ ActiveRecord::Schema.define(:version => 20170219070127) do
|
|||
|
||||
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
|
||||
|
||||
create_table "homework_bank_tests", :force => true do |t|
|
||||
t.text "input"
|
||||
t.text "output"
|
||||
t.boolean "test_type"
|
||||
t.integer "homework_bank_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "homework_banks", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
t.integer "homework_type"
|
||||
t.integer "quotes", :default => 0
|
||||
t.boolean "is_public"
|
||||
t.string "language"
|
||||
t.text "standard_code", :limit => 2147483647
|
||||
t.integer "min_num"
|
||||
t.integer "max_num"
|
||||
t.boolean "base_on_project"
|
||||
t.string "applicable_syllabus"
|
||||
t.integer "homework_common_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "homework_commons", :force => true do |t|
|
||||
t.string "name"
|
||||
t.integer "user_id"
|
||||
t.text "description"
|
||||
t.date "publish_time"
|
||||
t.date "end_time"
|
||||
t.datetime "publish_time"
|
||||
t.datetime "end_time"
|
||||
t.integer "homework_type", :default => 1
|
||||
t.string "late_penalty"
|
||||
t.integer "course_id"
|
||||
|
@ -1137,6 +1164,16 @@ ActiveRecord::Schema.define(:version => 20170219070127) do
|
|||
add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
|
||||
add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
|
||||
|
||||
create_table "homework_samples", :force => true do |t|
|
||||
t.text "input"
|
||||
t.text "output"
|
||||
t.integer "homework_common_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "homework_samples", ["homework_common_id"], :name => "index_homework_samples_on_homework_common_id"
|
||||
|
||||
create_table "homework_tests", :force => true do |t|
|
||||
t.text "input"
|
||||
t.text "output"
|
||||
|
@ -1154,6 +1191,19 @@ ActiveRecord::Schema.define(:version => 20170219070127) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "ii", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.string "author_login"
|
||||
t.string "rep_identifier"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "sonar_version", :default => 0
|
||||
t.string "path"
|
||||
t.string "branch"
|
||||
t.string "language"
|
||||
t.string "sonar_name"
|
||||
end
|
||||
|
||||
create_table "innodb_monitor", :id => false, :force => true do |t|
|
||||
t.integer "a"
|
||||
end
|
||||
|
@ -2264,7 +2314,8 @@ ActiveRecord::Schema.define(:version => 20170219070127) do
|
|||
t.datetime "updated_at", :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "status", :limit => 1, :default => 0
|
||||
t.integer "position", :limit => 1, :default => 0
|
||||
t.integer "position", :limit => 1
|
||||
t.integer "result", :default => 0
|
||||
end
|
||||
|
||||
create_table "user_actions", :force => true do |t|
|
||||
|
|
Loading…
Reference in New Issue