From 739e560a405d12af48f577516ab359195e5cba0e Mon Sep 17 00:00:00 2001
From: cxt
- 平台拟于2019年3月7日00:00--8:00进行全面升级,带来不便,敬请谅解! + 平台拟于2019年3月8日00:00--8:00进行全面升级,带来不便,敬请谅解!
From 729c079738900616811209a3c8f9274ae4b3b273 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Fri, 8 Mar 2019 12:16:18 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E5=88=A0=E9=99=A4gpid=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84myshixun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- lib/tasks/delete_error_myshixun.rake | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 lib/tasks/delete_error_myshixun.rake diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f147b9b2..e50827e3 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -384,7 +384,7 @@ class ShixunsController < ApplicationController shixun_id = shixun_id & my_shixun_ids end - @shixuns = Shixun.select([:id, :name, :user_id, :challenges_count, :visits, :status, :myshixuns_count, :trainee, :use_scope, :identifier, :image_text]).where(:id => shixun_id, :hidden => 0, :trainee => diff, :status => status).includes(:challenges, :schools, :shixun_members, :users) + @shixuns = Shixun.select([:id, :name, :user_id, :challenges_count, :visits, :status, :myshixuns_count, :trainee, :use_scope, :identifier, :image_text, :averge_star]).where(:id => shixun_id, :hidden => 0, :trainee => diff, :status => status).includes(:challenges, :schools, :shixun_members, :users) if search.present? search_users_id = User.select([:id]).where("concat(lastname, firstname) like '%#{search}%'") diff --git a/lib/tasks/delete_error_myshixun.rake b/lib/tasks/delete_error_myshixun.rake new file mode 100644 index 00000000..269b4536 --- /dev/null +++ b/lib/tasks/delete_error_myshixun.rake @@ -0,0 +1,11 @@ +namespace :myshixun do + desc "delete gpid is no" + task :delete_error_myshixuns => :environment do + begin + myshixuns = Myshixun.where(gpid: nil) + myshixuns.delete_all + rescue Exception => e + puts e + end + end +end From 5a41e4a15f2c616703f4463369194fa096a029fb Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Fri, 8 Mar 2019 12:26:29 +0800 Subject: [PATCH 05/13] 1 --- lib/tasks/delete_error_myshixun.rake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tasks/delete_error_myshixun.rake b/lib/tasks/delete_error_myshixun.rake index 269b4536..b9165a73 100644 --- a/lib/tasks/delete_error_myshixun.rake +++ b/lib/tasks/delete_error_myshixun.rake @@ -2,8 +2,11 @@ namespace :myshixun do desc "delete gpid is no" task :delete_error_myshixuns => :environment do begin - myshixuns = Myshixun.where(gpid: nil) - myshixuns.delete_all + myshixuns = Myshixun.where("gpid is null and created_at > '#{Time.now.beginning_of_day}'") + myshixuns.find_each do |m| + m.destroy + puts("#myshixun_id: #{m.id}") + end rescue Exception => e puts e end From e764011fcaf89c7faa3db8ee24926ba80837af09 Mon Sep 17 00:00:00 2001 From: huang暂未开发
- <%= link_to subject.name, "#{result ? subject_path(subject) : "javascript:void(0);"}", :class => "justify color-grey-name", :target => "_blank" %> + <%= link_to subject.name, "#{ result || subject.status >= 2 ? subject_path(subject) : "javascript:void(0);"}", :class => "justify color-grey-name", :target => "_blank" %>
<% if subject.stages_count > 0 %> From 3f09af9dbb40268e0636e77b2c66d4136f6e4809 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Fri, 8 Mar 2019 17:18:18 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/subjects/_subject_item.html.erb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/subjects/_subject_item.html.erb b/app/views/subjects/_subject_item.html.erb index d3ac4ebf..3dbc3605 100644 --- a/app/views/subjects/_subject_item.html.erb +++ b/app/views/subjects/_subject_item.html.erb @@ -1,19 +1,18 @@ -<% result = User.current.is_certification_teacher || User.current.member_of_subject?(subject) %> <% subjects.each do |subject| %>
暂未开发
- <%= link_to subject.name, "#{ result || subject.status >= 2 ? subject_path(subject) : "javascript:void(0);"}", :class => "justify color-grey-name", :target => "_blank" %> + <%= link_to subject.name, subject_path(subject), :class => "justify color-grey-name", :target => "_blank" %>
<% if subject.stages_count > 0 %> From b2db87cb02ac02c638c6a8b79351634c1156cdd1 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Sat, 9 Mar 2019 09:11:27 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_shixun_item.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/shixuns/_shixun_item.html.erb b/app/views/shixuns/_shixun_item.html.erb index 40420a8b..f4234b7f 100644 --- a/app/views/shixuns/_shixun_item.html.erb +++ b/app/views/shixuns/_shixun_item.html.erb @@ -1,21 +1,21 @@ -<% result = User.current.is_certification_teacher || User.current.admin? %> +<%# result = User.current.is_certification_teacher || User.current.admin? %> <% shixuns.each do |shixun| %>
暂未公开
-暂未公开
+- " class="justify color-grey-name" title="<%= shixun.name %>" target="_blank"><%= shixun.name %> + <%= shixun.name %>
From 4fe0bdb62030d471c29753dfe07714c82a53bfef Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Sat, 9 Mar 2019 09:14:45 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=97=A0=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_shixun_item.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_shixun_item.html.erb b/app/views/shixuns/_shixun_item.html.erb index f4234b7f..f3677a27 100644 --- a/app/views/shixuns/_shixun_item.html.erb +++ b/app/views/shixuns/_shixun_item.html.erb @@ -10,12 +10,12 @@暂未公开
- <%= shixun.name %> + <%= shixun.name %>
From 7e4bdd51abde93ae0141f8429fd9a761c92b5377 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Sat, 9 Mar 2019 14:30:20 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=88=B0=E5=A4=84=E5=A2=9E=E5=8A=A0=E8=AF=BE=E7=A8=8B=E4=BD=93?= =?UTF-8?q?=E7=B3=BB=E5=92=8C=E5=AE=9E=E8=AE=AD=E7=9A=84=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 14 ++++++++++---- app/models/subject.rb | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index fe5aa922..300f8911 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -4098,7 +4098,7 @@ end book = Spreadsheet::Workbook.new sheet1 = book.create_worksheet :name => "已发布实训课程" count_row = 2 - sheet1.row(1).concat(["", "地址", "实训课程名称","章节名称", "实训组成", "关卡数", "状态", "更新时间"]) + sheet1.row(1).concat(["", "地址", "实训课程名称","章节名称", "实训组成", "关卡数", "状态", "课程等级", "更新时间", "发布时间", ]) Rails.logger.warn("##########subjects:#{subjects.count}") subjects.each do |subject| sheet1[count_row,1] = "paths/"+subject.id.to_s @@ -4112,19 +4112,25 @@ end sheet1[count_row,5] = shixun.challenges.count sheet1[count_row,6] = shixun.shixun_status if s_index == 0 && index == 0 - sheet1[count_row,7] = format_time subject.updated_at + sheet1[count_row,7] = subject.subject_level_system.try(:name) || "--" + sheet1[count_row,8] = format_time subject.updated_at + sheet1[count_row,9] = format_time subject.publish_time end count_row += 1 end else if s_index == 0 - sheet1[count_row,7] = format_time subject.updated_at + sheet1[count_row,7] = subject.subject_level_system.try(:name) || "--" + sheet1[count_row,8] = format_time subject.updated_at + sheet1[count_row,9] = format_time subject.publish_time end count_row += 1 end end else - sheet1[count_row,7] = format_time subject.updated_at + sheet1[count_row,7] = subject.subject_level_system.try(:name) || "--" + sheet1[count_row,8] = format_time subject.updated_at + sheet1[count_row,9] = format_time subject.publish_time count_row += 1 end end diff --git a/app/models/subject.rb b/app/models/subject.rb index bd92c39c..59e84ee3 100644 --- a/app/models/subject.rb +++ b/app/models/subject.rb @@ -18,7 +18,7 @@ class Subject < ActiveRecord::Base has_many :tidings, :as => :container, :dependent => :destroy belongs_to :repertoire belongs_to :user - has_one :subject_level_system + belongs_to :subject_level_system scope :visible, lambda{where(status: 2)} From 14ef994d8471b915cda24214e8e4106959a7bbcc Mon Sep 17 00:00:00 2001 From: cxt