From d7492047df9922951c6dd8f3fcb1ee3d8a05966f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 15 Nov 2022 14:02:38 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queries/projects/list_query.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/queries/projects/list_query.rb b/app/queries/projects/list_query.rb index cb86981d4..ce97fcd9c 100644 --- a/app/queries/projects/list_query.rb +++ b/app/queries/projects/list_query.rb @@ -37,10 +37,11 @@ class Projects::ListQuery < ApplicationQuery ids = Projects::ElasticsearchService.call(params[:search]) items = items.where(platform: 'forge') if ids.present? - items.where(id: ids).by_name_or_identifier(params[:search]) + items = items.where(id: ids).by_name_or_identifier(params[:search]) else - items.by_name_or_identifier(params[:search]) + items = items.by_name_or_identifier(params[:search]) end + items.or(Project.visible.where(user_id: User.like(params[:search]).pluck(:id))) end def by_project_type(items) From 7e7e236d8702f8a3a1e651626137c7e2d5ca9dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 15 Nov 2022 14:05:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fixed=20=E5=A2=9E=E5=8A=A0=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E5=8F=91=E9=80=81=E8=80=85=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/user_mailer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 13cf2ac54..0b9c3aabc 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,7 +1,8 @@ class UserMailer < ApplicationMailer # 注意:这个地方一定要和你的邮箱服务域名一致 # default from: 'notification@trustie.org' - default from: 'noreply@gitlink.org.cn' + # default from: 'noreply@gitlink.org.cn' + default from: 'GitLink ' # 用户注册验证码 def register_email(mail, code) From 9b3bf2261928a8229bd99cb5054fc132cef89466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 15 Nov 2022 14:40:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87=E5=92=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/owner.rb | 5 +++++ app/queries/projects/list_query.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/owner.rb b/app/models/owner.rb index b65ee0544..2763dc80f 100644 --- a/app/models/owner.rb +++ b/app/models/owner.rb @@ -68,4 +68,9 @@ class Owner < ApplicationRecord has_many :repositories, foreign_key: :user_id, dependent: :destroy has_many :applied_transfer_projects, dependent: :destroy + scope :like, lambda { |keywords| + sql = "CONCAT(lastname, firstname) LIKE :search OR nickname LIKE :search OR login LIKE :search " + where(sql, :search => "%#{keywords.strip}%") unless keywords.blank? + } + end diff --git a/app/queries/projects/list_query.rb b/app/queries/projects/list_query.rb index ce97fcd9c..0a3cc3a4c 100644 --- a/app/queries/projects/list_query.rb +++ b/app/queries/projects/list_query.rb @@ -41,7 +41,7 @@ class Projects::ListQuery < ApplicationQuery else items = items.by_name_or_identifier(params[:search]) end - items.or(Project.visible.where(user_id: User.like(params[:search]).pluck(:id))) + items.or(Project.visible.where(user_id: Owner.like(params[:search]).pluck(:id))) end def by_project_type(items) From e5f2a7821a12417b3c93ed6d3738f17786a5eb6d Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 16 Nov 2022 15:27:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E8=AF=B7=E6=B1=82=E6=9F=A5=E8=AF=A2=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=A1=BB=E6=A0=B9=E6=8D=AE=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/issues/list_query_service.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/services/issues/list_query_service.rb b/app/services/issues/list_query_service.rb index bed8c4837..f7c23ddfd 100644 --- a/app/services/issues/list_query_service.rb +++ b/app/services/issues/list_query_service.rb @@ -17,7 +17,11 @@ class Issues::ListQueryService < ApplicationService issues = all_issues.issue_index_includes issues = issues.includes(pull_request: :reviewers) if status_type.to_s == "2" #表示关闭中的 - issues = issues.where(status_id: 5) + if(select_type == "Issue") + issues = issues.where(status_id: 5) + else + issues = issues.joins(:pull_request).where(pull_requests: {status: 2}) + end elsif status_type.to_s == "1" if(select_type == "Issue") issues = issues.where.not(status_id: 5) #默认显示开启中的