From b97a6935ea0543ed2dcb44538de2ff9754775b7d Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:12:38 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E5=A4=8D=E6=97=B6=E9=97=B4=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=B0=8F=E4=BA=8E=E4=B8=BB=E8=B4=B4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_message.rake | 36 ++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index ace16dbdf..44b28b336 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -54,19 +54,53 @@ namespace :sync do discusses = Discuss.where(dis_id: shixun_id).where("parent_id is null and created_at >? and created_at parent_time + large_time = random_time(start_time, end_time) + end + large_time + end end end From 5d2b98a27d3b69e3a3e80f37d51ede5f8395bb28 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:17:53 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_message.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 44b28b336..0db04aafc 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -68,7 +68,9 @@ namespace :sync do replies.each do |reply| reply_time = random_smaller_time(rand_created_on, start_time, end_time) reply_message = Message.create!(board_id: board_id.to_i, author_id: reply.user_id, parent_id: new_message.id, root_id: message_id) - MessageDetail.create!(message_id: reply_message.id, content: reply.try(:content)) + reply_message.update_columns(created_on: reply_time, updated_on: reply_time) + reply_message_detail = MessageDetail.create!(message_id: reply_message.id, content: reply.try(:content)) + reply_message_detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on) end end end From e8fea5cb3ee79beee956c14421ded38f514a79b0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 22 Aug 2019 16:21:31 +0800 Subject: [PATCH 03/12] admins: modify style --- app/helpers/application_helper.rb | 7 +++++-- .../daily_school_statistics/shared/_list.html.erb | 14 ++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e2a438faf..0f536433d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -438,7 +438,7 @@ module ApplicationHelper content_tag(:span, text, opts) end - def sort_tag(content, opts) + def sort_tag(content = '', **opts) options = {} options[:sort_by] = opts.delete(:name) is_current_sort = params[:sort_by].to_s == options[:sort_by] @@ -450,10 +450,13 @@ module ApplicationHelper when 'asc' then 'fa-sort-amount-asc' else '' end + opts[:style] = "#{opts[:style]} ;position: relative;" content_tag(:span, opts) do link_to path, remote: true do - content += content_tag(:i, '', class: "fa color-light-green ml-1 #{arrow_class}") if is_current_sort + content = content_tag(:span) { yield } if block_given? + + content += content_tag(:i, '', class: "fa color-light-green ml-1 #{arrow_class}", style: 'position: absolute;top:0;') if is_current_sort raw content end end diff --git a/app/views/admins/daily_school_statistics/shared/_list.html.erb b/app/views/admins/daily_school_statistics/shared/_list.html.erb index af23e09f6..611acdd2a 100644 --- a/app/views/admins/daily_school_statistics/shared/_list.html.erb +++ b/app/views/admins/daily_school_statistics/shared/_list.html.erb @@ -1,19 +1,21 @@ - + - - - + + From 97aecd0ea4757e34c47195cc54010cd2eac9e0c5 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:25:45 +0800 Subject: [PATCH 04/12] .. --- lib/tasks/public_message.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 0db04aafc..9d145df27 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -67,6 +67,7 @@ namespace :sync do if replies.present? replies.each do |reply| reply_time = random_smaller_time(rand_created_on, start_time, end_time) + puts("666") reply_message = Message.create!(board_id: board_id.to_i, author_id: reply.user_id, parent_id: new_message.id, root_id: message_id) reply_message.update_columns(created_on: reply_time, updated_on: reply_time) reply_message_detail = MessageDetail.create!(message_id: reply_message.id, content: reply.try(:content)) From 7e37da40b49e6662c995057e7c2e74cab02596c1 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:27:44 +0800 Subject: [PATCH 05/12] .. --- lib/tasks/public_message.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 9d145df27..dddc330cd 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -66,7 +66,7 @@ namespace :sync do message_detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on) if replies.present? replies.each do |reply| - reply_time = random_smaller_time(rand_created_on, start_time, end_time) + reply_time = smaller_time(rand_created_on, start_time, end_time) puts("666") reply_message = Message.create!(board_id: board_id.to_i, author_id: reply.user_id, parent_id: new_message.id, root_id: message_id) reply_message.update_columns(created_on: reply_time, updated_on: reply_time) @@ -98,7 +98,7 @@ namespace :sync do end # 子评论的时间必须小于父评论 - def random_smaller_time(parent_time, start_time, end_time) + def smaller_time(parent_time, start_time, end_time) large_time = random_time(start_time, end_time) while large_time > parent_time large_time = random_time(start_time, end_time) From c1ccb69a51c12d026c46090b2e12898cf90b1a42 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:30:51 +0800 Subject: [PATCH 06/12] .. --- lib/tasks/public_message.rake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index dddc330cd..437b9c37f 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -66,8 +66,12 @@ namespace :sync do message_detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on) if replies.present? replies.each do |reply| - reply_time = smaller_time(rand_created_on, start_time, end_time) - puts("666") + puts("reply id si #{reply.id}") + reply_time = random_time(start_time, end_time) + while reply_time > rand_created_on + reply_time = random_time(start_time, end_time) + end + reply_message = Message.create!(board_id: board_id.to_i, author_id: reply.user_id, parent_id: new_message.id, root_id: message_id) reply_message.update_columns(created_on: reply_time, updated_on: reply_time) reply_message_detail = MessageDetail.create!(message_id: reply_message.id, content: reply.try(:content)) From 03c9ff66f47b3be70c3d2bcfa04cee2f44174b81 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 16:39:10 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 6a4353aa2..c5d376baf 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -269,6 +269,6 @@ module CoursesHelper myshixun = Myshixun.where(user_id: user_id, shixun_id: subject&.shixuns).order("updated_at desc").first return "" unless myshixun stage_shixun = subject&.stage_shixuns.where(shixun_id: myshixun.shixun_id).take - progress = stage_shixun&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name + progress = stage_shixun&.stage&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name end end From 290c681a6b117a1267badedeb2312b5cfa46a59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 16:39:13 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= =?UTF-8?q?=EF=BC=8C=20=E5=BC=B9=E7=AA=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/modals/Jointheclass.js | 43 +++++++------------ .../src/modules/paths/PathDetail/DetailTop.js | 4 +- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/modals/Jointheclass.js b/public/react/src/modules/modals/Jointheclass.js index 40f62a6ac..0ad13c158 100644 --- a/public/react/src/modules/modals/Jointheclass.js +++ b/public/react/src/modules/modals/Jointheclass.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Modal} from 'antd'; import axios from 'axios'; +import Modals from './Modals'; //加入精品课堂 class Jointheclass extends Component { @@ -11,6 +12,12 @@ class Jointheclass extends Component { componentDidMount() { // console.log("加入精品课堂"); // console.log(this.props); + let type=this.props.yslJointhe===undefined?false:this.props.yslJointhe; + if(type===true){ + this.setState({ + Modalstype:true + }) + } } @@ -48,35 +55,15 @@ class Jointheclass extends Component { // console.log("加入精品课堂2"); //console.log(this.props.Pathcourseid); return( - -
-

是否确认加入该课堂?

-
- - this.modalCancel()}>取消 - this.setDownload()}>确认 -
-
-
+ this.modalCancel()} + modalSave={()=>this.setDownload()} + > ) } } -export default Jointheclass; \ No newline at end of file +export default Jointheclass; + diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 11f56169b..9110f4fcb 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -527,9 +527,7 @@ class DetailTop extends Component{
{item.course_status.status===0?
即将开课
:""} {item.course_status.status===1?
{item.course_status.time}
:""} - {item.course_status.status===2? - detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?
已结束
:item.course_identity<6? -
已结束
:"":""} + {item.course_status.status===2&&item.course_identity<6?
已结束
:""} {item.course_status.status===0? item.course_identity<5? From 39cc73134b0951db5a290867b09c1997d29c1476 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:44:40 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=AF=BC=E5=85=A5=E6=8C=89=E5=AE=9E=E8=AE=AD=E5=92=8C?= =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=8F=AF=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_message.rake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 437b9c37f..98dca8018 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -2,9 +2,10 @@ namespace :sync do task :public_message => :environment do subject_id = ENV['args'].split(",")[0] # 对应课程的id - board_id = ENV['args'].split(",")[1] - message_id = ENV['args'].split(",")[2] - status = ENV['args'].split(",")[3] # 表示相应的期数 + shixun_id = ENV['args'].split(",")[1] # 对应课程的id + board_id = ENV['args'].split(",")[2] + message_id = ENV['args'].split(",")[3] + status = ENV['args'].split(",")[4] # 表示相应的期数 if status.to_i == 1 start_time = '2018-12-16' @@ -21,7 +22,6 @@ namespace :sync do shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where subject_id=#{subject_id}) ").map(&:shixun_id) - discusses = Discuss.where(dis_id: shixun_ids).where("created_at >? and created_at ? and created_at Date: Thu, 22 Aug 2019 16:47:51 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=AF=BC=E5=85=A5=E6=8C=89=E5=AE=9E=E8=AE=AD=E5=92=8C?= =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=8F=AF=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_message.rake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 98dca8018..3beee5731 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -35,10 +35,11 @@ namespace :sync do end task :sigle_message => :environment do - shixun_id = ENV['args'].split(",")[0] # 对应课程的id - board_id = ENV['args'].split(",")[1] - message_id = ENV['args'].split(",")[2] - status = ENV['args'].split(",")[3] # 表示相应的期数 + subject_id = ENV['args'].split(",")[0] # 对应课程的id + shixun_id = ENV['args'].split(",")[1] # 对应课程的id + board_id = ENV['args'].split(",")[2] + message_id = ENV['args'].split(",")[3] + status = ENV['args'].split(",")[4] # 表示相应的期数 if status.to_i == 1 start_time = '2018-12-16' From b462d23cdc42c40f2e0b4a8d48d5ed74801036c1 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:50:09 +0800 Subject: [PATCH 11/12] .. --- lib/tasks/public_message.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 3beee5731..6c867241b 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -54,11 +54,11 @@ namespace :sync do end if subject_id.to_i == -1 - discusses = Shixun.where(dis_id: shixun_id).where("parent_id is nul") + discusses = Shixun.where("parent_id is nul and dis_id=?", shixun_id) else shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where subject_id=#{subject_id}) ").map(&:shixun_id) - discusses = Discuss.where(dis_id: shixun_ids).where("parent_id is null") + discusses = Discuss.where("parent_id is nul and dis_id=?", shixun_ids) end discusses.each do |discuss| From b3e07948fc21cd129b24c8126add99189dc60d95 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 16:51:13 +0800 Subject: [PATCH 12/12] .. --- lib/tasks/public_message.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 6c867241b..2636a454c 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -54,11 +54,11 @@ namespace :sync do end if subject_id.to_i == -1 - discusses = Shixun.where("parent_id is nul and dis_id=?", shixun_id) + discusses = Shixun.where("parent_id is null and dis_id=?", shixun_id) else shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where subject_id=#{subject_id}) ").map(&:shixun_id) - discusses = Discuss.where("parent_id is nul and dis_id=?", shixun_ids) + discusses = Discuss.where("parent_id is null and dis_id=?", shixun_ids) end discusses.each do |discuss|
单位名称单位名称 <%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('实训总数', name: 'shixun_count', path: admins_daily_school_statistics_path) %> - <%= sort_tag('实训评测总数', name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) %> - + + <%= sort_tag(name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) do %> + 实训评测总数 + + <% end %> <%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %>