-
+
全部
同意
拒绝
+
+ 请选择职业
+ 教师
+ 学生
+ 专业人士
+
+
+ 全部
+ 自动授权
+ 非自动授权
+
@@ -91,59 +102,55 @@
});
/* ----------------------- 已审批(全部) ------------------------- */
- $("#audit_all_authentication").on("click", function(){
- var iName = $("#audit_search_name").val();
- var sName = $("#school_search_name").val();
-
- $.ajax({
- url: "<%= trial_authorization_managements_path %>" + ".js",
- data: { name: iName, status: [1, 2], sname: sName }
- });
- });
+ $("#audit_all_authentication").on("click", function(){search_func([1, 2]);});
/* ----------------------- 已审批(同意) ------------------------- */
- $("#audit_agree_authentication").live("click", function(){
- var iName = $("#audit_search_name").val();
- var sName = $("#school_search_name").val();
-
- $.ajax({
- url: "<%= trial_authorization_managements_path %>" +".js",
- data: { name: iName, status: 1, sname: sName}
- });
- });
+ $("#audit_agree_authentication").live("click", function(){search_func(1);});
/* ----------------------- 已审批(拒绝) ------------------------- */
- $("#audit_reject_authentication").live("click", function(){
- var iName = $("#audit_search_name").val();
- var sName = $("#school_search_name").val();
+ $("#audit_reject_authentication").live("click", function(){search_func(2);});
- $.ajax({
- url: "<%= trial_authorization_managements_path %>" +".js",
- data: { name: iName, status: 2, sname: sName }
- });
+ /* ------------------- 按名字进行搜索(已审批)-------------------- */
+ $("#audit_search").live("click", function(){search_func(0);});
+ $("#user_identity").on("change", function(){search_func(0);});
+ $("#auto_school").on("change", function(){search_func(0);});
+
+ $("#audit_search_name, #school_search_name").on("keydown", function(e){
+ // 兼容FF和IE和Opera
+ var theEvent = e || window.event;
+ var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
+ if (code == 13) {
+ //回车执行查询
+ search_func(0);
+ }
});
- /* ------------------- 按名字进行搜索(已审批)-------------------- */
- $("#audit_search").live("click", function(){
+ function search_func(status){
var iName = $("#audit_search_name").val();
var sName = $("#school_search_name").val();
+ var identity = $("#user_identity").val();
+ var auto_school = $("#auto_school").val();
+ var type = status;
- var id = $("#audit_all_authentication").parent().find(".active").attr("id");
- var type = 0;
+ if(type == 0){
+ var id = $("#audit_all_authentication").parent().find(".active").attr("id");
- if(id == "audit_all_authentication"){
- type = [1, 2];
- }else if(id=="audit_agree_authentication"){
- type = 1;
- }else{
- type = 2;
+ if(id == "audit_all_authentication"){
+ type = [1, 2];
+ }else if(id=="audit_agree_authentication"){
+ type = 1;
+ }else{
+ type = 2;
+ }
}
-// alert(type);
+
$.ajax({
url: "<%= trial_authorization_managements_path %>" +".js",
- data: { search: iName, status: type, sname: sName}
+ data: { search: iName, status: type, sname: sName, identity: identity, auto_school: auto_school}
});
- });
+ }
+
+
// $(document).keyup(function(event){
// if(event.keyCode == 13){
diff --git a/app/views/managements/users.html.erb b/app/views/managements/users.html.erb
index e707214e..9b01dab3 100644
--- a/app/views/managements/users.html.erb
+++ b/app/views/managements/users.html.erb
@@ -1,40 +1,53 @@
<%= form_tag(url_for(users_managements_path), :id => "managements_users_search", :method => "post", :remote => true) do %>
-
-
全部状态
-
-
- 全部状态
- 活动的(<%= query_user_status_num 1 %>)
- 未激活(<%= query_user_status_num 2 %>)
- 已锁定(<%= query_user_status_num 3 %>)
-
-
-
-
真实姓名搜索
-
-
- 真实姓名搜索
- 用户id搜索
- 邮箱地址搜索
- 手机号码搜索
-
-
-
-
-
-
-
-
-
-
-
-
+
+
全部状态
+
+
+ 全部状态
+ 活动的(<%= query_user_status_num 1 %>)
+ 未激活(<%= query_user_status_num 2 %>)
+ 已锁定(<%= query_user_status_num 3 %>)
+
+
+
+
真实姓名搜索
+
+
+ 真实姓名搜索
+ 用户id搜索
+ 邮箱地址搜索
+ 手机号码搜索
+
+
-
搜索
-
清除
+
+ 请选择职业
+ 教师
+ 学生
+ 专业人士
+
+
+ 全部
+ 自动授权
+ 非自动授权
+
-
+
+
+
+
+
+
+
+
+
+
+
+
搜索
+
清除
+
+
课堂添加成员
<% end %>
@@ -42,7 +55,7 @@
<%= render :partial => "managements/user_list" %>
\ No newline at end of file
diff --git a/app/views/managements/users.html.erb b/app/views/managements/users.html.erb
index 9b01dab3..3117e124 100644
--- a/app/views/managements/users.html.erb
+++ b/app/views/managements/users.html.erb
@@ -44,6 +44,9 @@
+
+
+
搜索
清除
From 99a47e1c8ec47c97714ada703b51bc94c0cc6483 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 19 Mar 2019 16:08:55 +0800
Subject: [PATCH 07/12] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=91=98=E7=9A=84=E8=87=AA=E5=8A=A8=E6=8E=88=E6=9D=83=E5=8D=95?=
=?UTF-8?q?=E4=BD=8D=E5=88=97=E8=A1=A8=E4=B8=AD=EF=BC=8C=E4=BB=85=E7=BB=99?=
=?UTF-8?q?=E2=80=9D=E5=AD=A6=E7=94=9F=E2=80=9C=E8=87=AA=E5=8A=A8=E6=8E=88?=
=?UTF-8?q?=E6=9D=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 34552787..e5f4f8b4 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -1038,7 +1038,7 @@ class AccountController < ApplicationController
apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first
school_ids = School.where(:auto_users_trial => 1).map(&:id)
user_ex = User.current.user_extensions
- if (user_ex.identity == 0 || (user_ex.identity == 1 && user_ex.student_id.present?)) && !user_ex.school.nil? && school_ids.include?(user_ex.school_id)
+ if user_ex.identity == 1 && user_ex.student_id.present? && !user_ex.school.nil? && school_ids.include?(user_ex.school_id)
User.current.update_attributes(:certification => 1)
logger.warn("apply_trail #######{User.current.login} ****#{User.current.user_extensions.school_id}")
@tip = "申请已提交,我们将在1分钟内完成审核"
From a8fb7072305beaf3fd83a10fe720504588acb9e0 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Tue, 19 Mar 2019 16:19:06 +0800
Subject: [PATCH 08/12] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=90=8C=E6=AD=A5?=
=?UTF-8?q?=E8=BF=87=E6=9D=A5=E7=9A=84=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=9C=89?=
=?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E6=83=85=E5=86=B5=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/ecloud_controller.rb | 2 +-
app/models/user.rb | 38 ++++++++++++++++------------
2 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/app/controllers/ecloud_controller.rb b/app/controllers/ecloud_controller.rb
index c49b34a6..6ff6d1ef 100644
--- a/app/controllers/ecloud_controller.rb
+++ b/app/controllers/ecloud_controller.rb
@@ -43,7 +43,7 @@ class EcloudController < ApplicationController
CLIENT_ID = '1056'
CLIENT_SECRET = '2e84256a-3de4-4713-9e02-10ee88a14592'
SERVER_URL = "https://221.176.53.130:44390/services/"
-
+q
## 签名
diff --git a/app/models/user.rb b/app/models/user.rb
index fdb9566a..31c58f26 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1693,31 +1693,37 @@ class User < Principal
end
def self.create_with_ecoder!(info)
- user = User.new
- user.admin = false
- user.login = "ecoder_" + info["mobile"]
+ user = User.find_by_phone(info["mobile"])
- user.phone = info["mobile"]
+ # 如果手机号存在,则直接绑定用户
+ # 因为手机号可以取回密码,所以可以视为同一用户
+ unless user
+ user = User.new
+ user.admin = false
+ user.login = "ecoder_" + info["mobile"]
- unless User.find_by_mail(info["email"])
- user.mail = info["email"]
- end
- user.nickname = info["username"]
+ user.phone = info["mobile"]
+
+ unless User.find_by_mail(info["email"])
+ user.mail = info["email"]
+ end
+ user.nickname = info["username"]
- user.activate
- user.last_login_on = Time.now
+ user.activate
+ user.last_login_on = Time.now
- user.ecoder_user_id = info["userid"]
+ user.ecoder_user_id = info["userid"]
- user.save!(:validate => false)
+ user.save!(:validate => false)
- UserStatus.create!(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
+ UserStatus.create!(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
- ue = user.user_extensions ||= UserExtensions.new
- ue.user_id = user.id
- ue.save!
+ ue = user.user_extensions ||= UserExtensions.new
+ ue.user_id = user.id
+ ue.save!
+ end
user
end
From ebe9ee145b81345058b32a1f3197fdb040eb7940 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 19 Mar 2019 16:45:14 +0800
Subject: [PATCH 09/12] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?=
=?UTF-8?q?=E7=9A=84=E5=BC=80=E5=90=AF=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/shixun_work_report.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/student_work/shixun_work_report.html.erb b/app/views/student_work/shixun_work_report.html.erb
index 34449b17..a7307405 100644
--- a/app/views/student_work/shixun_work_report.html.erb
+++ b/app/views/student_work/shixun_work_report.html.erb
@@ -76,7 +76,7 @@
延时
<% end %>
- <%= game.try(:open_time).nil? ? "--" : format_time(game.open_time) %>
+ <%= game.try(:open_time).nil? || game.status == 3 ? "--" : format_time(game.open_time) %>
<% user_query = @game_user_query.select{|user_query| user_query[0] == game.id} %>
<%= user_query.blank? ? "--" : user_query.first[1] %>
<%= game.try(:end_time).nil? ? "--" : format_time(game.end_time) %>
From 0c643a82b86644eba2098bfceb3761dd8d1eb622 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 19 Mar 2019 17:05:08 +0800
Subject: [PATCH 10/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/views/shixuns/_shixun_top.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb
index fb7dcd21..5703e66d 100644
--- a/app/views/shixuns/_shixun_top.html.erb
+++ b/app/views/shixuns/_shixun_top.html.erb
@@ -15,7 +15,7 @@
<% if @shixun.myshixuns.count > 0 %>
学习人数
- <%= @shixun.myshixuns.count %>
+ <%= @shixun.myshixuns_count %>
<% end %>
From f1b17212b488f2a703b62a3711bcd6b6b84aded3 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 19 Mar 2019 18:01:06 +0800
Subject: [PATCH 11/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/controllers/account_controller.rb | 2 +-
app/controllers/managements_controller.rb | 8 +++++---
.../account/_pro_certification_form.html.erb | 3 +++
.../account/professional_certification.html.erb | 3 +++
public/javascripts/educoder/edu_account.js | 15 +++++++++------
5 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index e5f4f8b4..8f3a2b53 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -891,7 +891,7 @@ class AccountController < ApplicationController
@user = User.current
@se = @user.extensions
# 已授权的用户修改单位名称,需要重新授权
- if @se.school_id != params[:occupation].to_i && @user.certification == 1
+ if (@se.school_id != params[:occupation].to_i || @se.identity != params[:identity].to_i) && @user.certification == 1
@user.certification = 0
apply_user = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization")
apply_user.update_all(:status => 2) unless apply_user.blank?
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index 599e8da4..7a8e6495 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -3194,15 +3194,17 @@ end
def trial_authorization
@menu_type =10
@sub_type = 2
- search = params[:search]
+ name_search = params[:search]
@status = trial_authorization_status(params[:status])
# @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2]
user_id = []
search = false
@authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status)
- unless search.blank?
- user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'").map(&:id)
+ unless name_search.blank?
+ new_user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{name_search}%'").map(&:id)
+ user_id = user_id.size == 0 ? new_user_id : user_id & new_user_id
+ search = true
end
if params[:sname] && params[:sname].strip != ''
diff --git a/app/views/account/_pro_certification_form.html.erb b/app/views/account/_pro_certification_form.html.erb
index 962843f7..8c5552af 100644
--- a/app/views/account/_pro_certification_form.html.erb
+++ b/app/views/account/_pro_certification_form.html.erb
@@ -10,6 +10,9 @@
* 职业:
+ <% if @user.certification == 1 %>
+
+ <% end %>
请选择职业
教师
diff --git a/app/views/account/professional_certification.html.erb b/app/views/account/professional_certification.html.erb
index fafd8b6e..63c10d54 100644
--- a/app/views/account/professional_certification.html.erb
+++ b/app/views/account/professional_certification.html.erb
@@ -28,6 +28,9 @@
* 职业:
+ <% if @user.certification == 1 %>
+
+ <% end %>
请选择职业
教师
diff --git a/public/javascripts/educoder/edu_account.js b/public/javascripts/educoder/edu_account.js
index eedc4db5..c88238e5 100644
--- a/public/javascripts/educoder/edu_account.js
+++ b/public/javascripts/educoder/edu_account.js
@@ -1032,9 +1032,10 @@ function submit_pro_certification(type){
}
}
else if (data.result == 1){
- if($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()){
+ if(($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()) ||
+ ($("#user_certi_identity").length == 1 && $("#user_certi_identity").val() != $("input[name='identity']").val().trim())){
var htmlvalue = '