From 07941233d8f6793895341994599a371034b808bb Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 3 Jun 2016 17:03:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A2=98=E5=BA=93=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=88=B0=E5=90=8E=EF=BC=8C=E5=85=88=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E4=B8=80=E4=B8=AA=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E8=AF=BE=E7=A8=8BID=EF=BC=8C=E7=82=B9=E5=87=BB=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=EF=BC=8C=E5=9C=A8=E5=87=BA=E7=8E=B0=E8=AF=B7=E5=85=88?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=90=8E=E5=88=A0=E9=99=A4=E8=BE=93=E5=85=A5=E7=9A=84ID?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E6=97=B6=E4=BC=9A=E6=98=BE=E7=A4=BA=E5=87=BA?= =?UTF-8?q?=E8=AF=A5=E7=94=A8=E6=88=B7=E6=89=80=E6=9C=89=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=EF=BC=8C=E5=8C=85=E6=8B=AC=E5=B7=B2=E7=BB=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4cb838b8c..009d5c4d6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -575,7 +575,7 @@ class UsersController < ApplicationController end if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)} + @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and (#{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p)",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)} else @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)} end From dab24567f2aa9947ce21d3f69a52c5d2b0cedff7 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 3 Jun 2016 17:21:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/wechat_service.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb index f9a59e080..3169763c4 100644 --- a/app/services/wechat_service.rb +++ b/app/services/wechat_service.rb @@ -115,7 +115,7 @@ class WechatService data = { touser:openid, template_id:template_id, - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}", topcolor:"#FF0000", data:{ first: { @@ -143,7 +143,7 @@ class WechatService data = { touser:openid, template_id:template_id, - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}", topcolor:"#FF0000", data:{ first: { @@ -181,7 +181,7 @@ class WechatService data = { touser:uw.openid, template_id:Wechat.config.binding_succ_notice, - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities", topcolor:"#FF0000", data:{ first: {