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

chromesetting
daiao 5 years ago
commit 4846817868

@ -6,6 +6,7 @@ class TidingsController < ApplicationController
def index
tidings = current_user.tidings
@onclick_time = current_user.click_time
tiding_types =
case params[:type]
@ -18,11 +19,13 @@ class TidingsController < ApplicationController
end
tidings = tidings.where(tiding_type: tiding_types) if tiding_types.present?
tidings = tidings.where(container_type: 'JoinCourse') if params[:type] == 'course_apply'
@course_apply_count = tidings.where("created_at > '#{@onclick_time}'").where(container_type: 'JoinCourse').count
tidings = tidings.where(container_type: 'ProjectPackage') if params[:type] == 'project_package'
@count = tidings.count
@tidings = paginate(tidings.order(created_at: :desc), per_page: 10)
@onclick_time = current_user.click_time
end
private

@ -35,6 +35,9 @@ class Weapps::CoursesController < Weapps::BaseController
# 教师列表
def teachers
@course = current_course
@page = (params[:page] || 1).to_i
@limit = (params[:limit] || 20).to_i
search = params[:search].present? ? params[:search].strip : ""
if @course.try(:id) != 1309 || current_user.admin? || current_user.try(:id) == 15582
@teacher_list = @course.course_members.joins(:user).where("course_members.role in (1, 2, 3)")
else
@ -42,17 +45,26 @@ class Weapps::CoursesController < Weapps::BaseController
and course_members.role = 2))")
end
if search.present?
@teacher_list = @teacher_list.joins(:user).where("LOWER(CONCAT(users.lastname, users.firstname)) like ?", "%#{search}%")
end
@teacher_list_size = @teacher_list.size
@applications_size = CourseMessage.unhandled_join_course_requests_by_course(@course).size
@teacher_list = @teacher_list.preload(user: [user_extension: :school])
@teacher_list = @teacher_list.includes(user: [user_extension: :school])
# 中英文混合排序(忽略大小写)
@teacher_list = @teacher_list.sort {|x, y| Pinyin.t(x.user&.real_name, splitter: '').upcase <=> Pinyin.t(y.user&.real_name, splitter: '').upcase}
@teacher_list = @teacher_list[(@page-1)*@limit ... @page*@limit]
end
# 批量删除教师或助教
def delete_course_teachers
begin
@course = current_course
@page = (params[:page] || 1).to_i
@limit = (params[:limit] || 20).to_i
course_members = @course.course_members.where(id: params[:course_member_ids], role: %i[PROFESSOR ASSISTANT_PROFESSOR])
user_ids = course_members.pluck(:user_id)
course_members.destroy_all
@ -67,10 +79,18 @@ class Weapps::CoursesController < Weapps::BaseController
def students
@course = current_course
@page = (params[:page] || 1).to_i
@limit = (params[:limit] || 20).to_i
search = params[:search].present? ? params[:search].strip : nil
course_group_id = params[:course_group_id].present? ? params[:course_group_id].to_i : nil
@students = CourseMember.students(@course)
if search.present?
@students = @students.joins(user: :user_extension).where("LOWER(CONCAT(users.lastname, users.firstname)) like ? or
user_extensions.student_id like ?", "%#{search}%", "%#{search}%")
end
if course_group_id.present?
course_group = CourseGroup.find(course_group_id) if course_group_id != 0
@students = @students.where(course_group_id: course_group&.id.to_i)
@ -78,6 +98,9 @@ class Weapps::CoursesController < Weapps::BaseController
@students_count = @students.size
@students = @students.includes(user: :user_extension)
# 中英文混合排序(忽略大小写)
@students = @students.sort {|x, y| Pinyin.t(x.user&.real_name, splitter: '').upcase <=> Pinyin.t(y.user&.real_name, splitter: '').upcase}
@students = @students[(@page-1)*@limit ... @page*@limit]
end
# 批量修改角色

@ -20,10 +20,10 @@ module Weapps::CoursesHelper
end
end
end
data = data.sort do |a, b|
[a[:letter]] <=> [b[:letter]]
end
data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后
# data = data.sort do |a, b|
# [a[:letter]] <=> [b[:letter]]
# end
# data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后
return data
end
@ -47,10 +47,10 @@ module Weapps::CoursesHelper
end
end
end
data = data.sort do |a, b|
[a[:letter]] <=> [b[:letter]]
end
data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后
# data = data.sort do |a, b|
# [a[:letter]] <=> [b[:letter]]
# end
# data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后
return data
end

@ -1,2 +1,3 @@
json.count @count
json.tidings @tidings, partial: 'tidings/tiding', as: :tiding
json.course_apply_count @course_apply_count

@ -80,6 +80,27 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.inner-footernav li{float: left;height: 50px;width: 80px;text-align: center}
.inner-footernav li a{width: 100%;text-align: center;line-height: 50px;color: #888}
.inner-footer_con{ width: 1200px; margin: 0 auto;}
.inner-footernavysl{ display: flex;flex-direction:initial;}
.inner-footernavysl li a {
height: 40px;
line-height: 40px;
color:#878786;
font-size: 19px;
}
.inner-footernavysl li Link {
height: 40px;
line-height: 40px;
color:#878786;
}
.intermediatecenter{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.footer_con-p{ color: #888; margin-top:10px;}
/*banner图*/
.banner{width:100%;height:345px;position: relative;overflow: hidden;border-radius: 10px;}

@ -18,6 +18,18 @@ class NewFooter extends Component {
render() {
return (
<div className="newFooter edu-txt-center ">
<style>
{
`
.newFooter {
max-height: 140px !important;
padding-bottom: 20px !important;
}
`
}
</style>
{/*newContainers*/}
<div className="inner-footer_con">
{this.props.user&&this.props.user.main_site===true?<div className="footercon">

@ -84,6 +84,27 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.inner-footernav li{float: left;height: 50px;width: 80px;text-align: center}
.inner-footernav li a{width: 100%;text-align: center;line-height: 50px;color: #888}
.inner-footer_con{ width: 1200px; margin: 0 auto;}
.inner-footernavysl{ display: flex;flex-direction:initial;}
.inner-footernavysl li a {
height: 40px;
line-height: 40px;
color:#878786;
font-size: 19px;
}
.inner-footernavysl li Link {
height: 40px;
line-height: 40px;
color:#878786;
}
.intermediatecenter{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.footer_con-p{ color: #888; margin-top:10px;}
/*banner图*/
.banner{width:100%;height:345px;position: relative;overflow: hidden;border-radius: 10px;}
@ -3773,4 +3794,4 @@ a.singlepublishtwo{
.fontweightbold{
font-weight: bold !important;
}
}

Loading…
Cancel
Save