Merge branch 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into topic_bank

dev_aliyun_beta
杨树林 5 years ago
commit b855958f64

@ -1,5 +1,5 @@
#coding=utf-8
# 执行示例 bundle exec rake public_course:student args=149,2903
# 执行示例 RAILS_ENV=production bundle exec rake public_classes:student args=3,3056,'2019-03-01','2019-03-31',10,1
# args 第一个参数是subject_id第二个参数是课程course_id
# 第一期时间2018-12-16 至2019-03-31
# 第二期时间2019-04-07 至2019-07-28
@ -22,10 +22,13 @@ namespace :public_classes do
task :student => :environment do
puts "subject_id is #{subject_id}"
puts "course_id is #{course_id}"
puts "start time is #{start_time}"
puts "end time is #{end_time}"
puts "limt is #{limit}"
user_ids = Myshixun.find_by_sql("select distinct(user_id) from myshixuns where created_at between #{start_time} and #{end_time} and shixun_id in (select shixun_id from stage_shixuns
user_ids = Myshixun.find_by_sql("select distinct(user_id) from myshixuns where created_at between '#{start_time}' and '#{end_time}' and shixun_id in (select shixun_id from stage_shixuns
where stage_id in (select id from stages where subject_id=#{subject_id})) limit #{limit}").map(&:user_id)
puts user_ids
puts "user_ids count is #{user_ids.count}"
if user_ids.present?
user_ids.each do |user_id|
puts user_id
@ -39,8 +42,8 @@ namespace :public_classes do
end
task :test_user => :environment do
users = User.where(is_test: true)
users.limit(limit).find_each do |user|
users = User.where(is_test: true).limit(limit)
users.find_each do |user|
puts user.id
CourseMember.create!(course_id: course_id, user_id: user.id, role: 4)
end

@ -1,30 +1,22 @@
# bundle exec rake sync:public_message args=149,2903
namespace :sync do
task :public_message => :environment do
if ENV['args']
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'
end_time = '2019-04-01'
elsif status.to_i == 2
start_time = '2019-04-07'
end_time = '2019-07-28'
else
# 这种情况是取所有的
start_time = '2015-01-01'
end_time = '2022-07-28'
start_time = ENV['args'].split(",")[4] # 表示课程模块
end_time = ENV['args'].split(",")[5] # 表示课程模块
limit = ENV['args'].split(",")[6] # 限制导入的数量
end
task :public_message => :environment 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 <?", start_time, end_time)
if discusses.present?
discusses.find_each do |discuss|
discusses.limit(limit).find_each do |discuss|
puts discuss.user_id
puts board_id
puts message_id
@ -35,23 +27,6 @@ namespace :sync do
end
task :sigle_message => :environment do
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'
end_time = '2019-04-01'
elsif status.to_i == 2
start_time = '2019-04-07'
end_time = '2019-07-28'
else
# 这种情况是取所有的
start_time = '2015-01-01'
end_time = '2022-07-28'
end
if subject_id.to_i == -1
discusses = Discuss.where("parent_id is null and dis_id=?", shixun_id)
@ -119,18 +94,8 @@ namespace :sync do
end
end
task :board_count => :environment do
Course.find_each do |course|
puts course.id
begin
messages_count = Message.find_by_sql("select count(*) as count from messages where board_id in (select id from boards where course_id=#{course.id})").first.try(:count)
Board.update_column(messages_count: messages_count)
rescue
end
end
task :delete_boards => :environment do
course = Course.find(course_id)
course.boards.destroy
end
end

File diff suppressed because one or more lines are too long

@ -299,6 +299,7 @@ class App extends Component {
axios.post(url, {
url: 'http://pre-newweb.educoder.net',
}).then((response) => {
console.log('got res')
const data = response.data;
wx.config({
debug: false,
@ -316,6 +317,7 @@ class App extends Component {
]
});
wx.ready(function () {
console.log('wx is ready')
var shareData = {
title: '这是是分享标题',
desc: '这是是摘要',
@ -333,6 +335,8 @@ class App extends Component {
});
wx.error(function (res) {
console.log('wx is error')
console.log(res)
//alert(res.errMsg);//错误提示
});

@ -30,7 +30,8 @@ class Fileslistitem extends Component{
showfiles=(list)=>{
if(list.is_history_file===false){
// this.props.DownloadFileA(list.title,list.url)
window.location.href=list.url;
//window.location.href=list.url;
window.open(list.url, '_blank');
}else{
let {discussMessage,coursesId}=this.props
let file_id=discussMessage.id
@ -49,7 +50,7 @@ class Fileslistitem extends Component{
//
// }
// this.props.DownloadFileA(result.data.title,result.data.url)
window.location.href=list.url;
window.open(list.url, '_blank');
}else{
this.setState({
Showoldfiles:true,

@ -34,6 +34,7 @@ class AccessoryModal2 extends Component{
}
// 附件相关 START
handleChange = (info) => {
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed'){
let fileList = info.fileList;
console.log(fileList)
// for(var list of fileList ){
@ -42,6 +43,8 @@ class AccessoryModal2 extends Component{
this.setState({ fileList });
}
}
onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',

@ -253,7 +253,7 @@ class Selectsetting extends Component{
// 附件相关 START
handleChange = (info) => {
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
if (info.file.status != "removed") {
this.setState({
@ -265,7 +265,7 @@ class Selectsetting extends Component{
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
}
}
// onAttachmentRemove = (file) => {

@ -178,7 +178,7 @@ class Showoldfiles extends Component{
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}>
<li className="fl fontlefts">
<a className={"isabox"} href={allfiles.url} >{allfiles.title}</a>
<a className={"isabox"} href={allfiles.url} target="_blank" >{allfiles.title}</a>
{/*{allfiles.is_pdf===false?*/}
{/*<a className={"isabox"} href={allfiles.url} >{allfiles.title}</a>:*/}
{/*<a className={"isabox"} onClick={()=>this.showfiless(allfiles.url)} >{allfiles.title}</a>*/}
@ -198,7 +198,7 @@ class Showoldfiles extends Component{
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}>
<li className="fl fontlefts">
<a className={"isabox"} href={item.url}>{item.title}</a>
<a className={"isabox"} href={item.url} target="_blank" >{item.title}</a>
{/*{item.is_pdf===false?*/}
{/*<a className={"isabox"} href={item.url}>{item.title}</a>:*/}
{/*<a className={"isabox"} onClick={()=>this.showfiless(item.url)} >{item.title}</a>*/}

@ -86,7 +86,7 @@ class Sendresource extends Component{
}
// 附件相关 START
handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
if (info.file.status != "removed") {
this.setState({
@ -99,6 +99,7 @@ class Sendresource extends Component{
});
}
}
}
// onAttachmentRemove = (file) => {
//

@ -145,6 +145,9 @@ class WebSSHTimer extends Component {
}
// 重置命令行的时候调用的接口会删pod
closeWebssh = (callback) => {
// 先关socket
this.closeWebsshSocket()
const { game } = this.props;
// const url = `/api/v1/games/${game.identifier}/close_webssh`
const url = `/tasks/${game.identifier}/close_webssh.json`

@ -759,6 +759,7 @@ class Newshixuns extends Component {
// 附件相关 START
handleChange = (info) => {
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
@ -768,10 +769,11 @@ class Newshixuns extends Component {
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList: fileLists,
deleteisnot:false});
deleteisnot: false
});
// }
}
}
}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){

Loading…
Cancel
Save