From 0a7995004655f471f6160141b0f9f55724fe29dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Wed, 31 Aug 2022 10:38:21 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E8=B0=83=E6=95=B4nps=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B0=83=E7=A0=94=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/nps_controller.rb | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/app/controllers/nps_controller.rb b/app/controllers/nps_controller.rb index 2e1b552b..35dac164 100644 --- a/app/controllers/nps_controller.rb +++ b/app/controllers/nps_controller.rb @@ -1,28 +1,15 @@ class NpsController < ApplicationController + # close,关闭 + # createIssue,创建issue + # createPullRequest,创建PR + # auditPullRequest,审核PR + # indexProject,项目主页 + # createProject,创建项目 + # createOrganization,创建组织 def create - tip_exception "缺少参数" if params[:action_id].blank? - action_type ||= begin - case params[:action_id].to_s - when '0' then - 'close' - when '1' then - 'createIssue' - when '2' then - 'createPullRequest' - when '3' then - 'auditPullRequest' - when '4' then - 'forkProject' - when '5' then - 'createProject' - when '6' then - 'createOrganization' - else - "#{params[:action_type].to_s}" - end - end - UserNp.create(:action_id => params[:action_id], :action_type => "#{action_type}", :user_id => User.current.id, :score => params[:score].to_f, memo: params[:memo]) + tip_exception "缺少参数" if params[:action_id].blank? || params[:action_type].blank? + UserNp.create(:action_id => params[:action_id].to_i, :action_type => params[:action_type], :user_id => User.current.id, :score => params[:score].to_f, memo: params[:memo]) render_ok end end From 32a9d762d8dc3aa17b77281148399bd81e66d5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Wed, 31 Aug 2022 10:39:52 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E8=B0=83=E6=95=B4nps=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B0=83=E7=A0=94=E6=8E=A5=E5=8F=A3,=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/nps_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/nps_controller.rb b/app/controllers/nps_controller.rb index 35dac164..f16b2606 100644 --- a/app/controllers/nps_controller.rb +++ b/app/controllers/nps_controller.rb @@ -1,5 +1,7 @@ class NpsController < ApplicationController + before_action :require_login + # close,关闭 # createIssue,创建issue # createPullRequest,创建PR From f412172438862d456d020e3a92fe30bed6f02c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Mon, 5 Sep 2022 11:38:23 +0800 Subject: [PATCH 03/14] =?UTF-8?q?nps=E5=B7=B2=E6=89=93=E5=88=86=E5=8C=BA?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/nps_controller.rb | 1 + app/views/admins/nps/_user_np_list.html.erb | 2 +- app/views/admins/nps/index.html.erb | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/admins/nps_controller.rb b/app/controllers/admins/nps_controller.rb index 4eacba4e..491e6277 100644 --- a/app/controllers/admins/nps_controller.rb +++ b/app/controllers/admins/nps_controller.rb @@ -7,6 +7,7 @@ class Admins::NpsController < Admins::BaseController sql = 'CONCAT(users.lastname, users.firstname) LIKE :keyword OR users.nickname LIKE :keyword OR users.login LIKE :keyword OR users.mail LIKE :keyword OR users.phone LIKE :keyword' @user_nps = @user_nps.where(sql, keyword: "%#{keyword}%") end + @user_nps = @user_nps.where("action_type != 'close'") if params[:done_score].present? @user_nps = paginate @user_nps.includes(:user) end diff --git a/app/views/admins/nps/_user_np_list.html.erb b/app/views/admins/nps/_user_np_list.html.erb index f4246c70..f2d5196e 100644 --- a/app/views/admins/nps/_user_np_list.html.erb +++ b/app/views/admins/nps/_user_np_list.html.erb @@ -21,7 +21,7 @@
ywl$EybSKk?F=!>BKQ;r5Q|Lr)69xrBd+
zUB+GIHO?o#qLG$?ABEG{+f@=nMiQt*3hhf02H9 RkMr*aCZ== Y ~uhkBu!?1Y!H7V%O5Gpk^M+!CfggxqUvv;^~{}tNa8G;
z!fKWotsn&m|J3!s$EY}O>0EdT=mqIV$mQGz=DH3;X#391O7%+ICF#YWu?wNvAHe6&
zWQUH9r^sEB4j2KQhx#_%Dz49rM(rIr5I~`e=e?aC1c_8N0ZwAkro(N1nT9`%)-$rF
zgw{0-t!=X+LlK=^K=0>tMB1Ux^13@bs0*VTDcb+&^C}doecOQ=
zs>4Rodyz%1wjxGA#UGxOkiAHF)V&VR$lf|`lCYtUykte_imLCk7e4&EBKxn>6Y8zn
z)m)fjJ&gL))nJeLJd|XBh=zB((!k0pp2$aw6l=5yF&VrklPm_m`WlVfU9PHVy25
zYHO%35Xx9Ji-i`!;hB>IaDyyd)->NuD*sn8@+R+{z+m;0>S@P2ZN51W9;QEn)9@-K
zzw?H3Bj)hyuGctU5KEO1eUC5qD72B5v`s&&&k0b{G{65GRs0Ol@Py+#n_r5_n*78oCy-zrU#Xv`wp1
z0>hM>SZ86-mFAOOCu6Oa1@8(bNgpVAK>?KEF*+rpk0SWgyf{dzp8=I;op7K2FUMt-
zW*@ZN9uBKhkbxK;;q6#N(TP&>``bt4G}x!;k@~rj$hgcn@h_robYmTWfW?%zO7#cd
z@bDV)+vf(_H=?>~1g3*q5Uw8=fE9~0PnNpbB=_VV(Qnn?Us@d5)lS?#jH;zyH=G_N
zhFtvCvIGD@ye?}iGt+c2d<$#5!VhZEq<)T}Eb8R*o8L`)Hm6*6{Uc4Z=G7U6u8TUF
zetY?@dH>l;Hx<5zSpgiZ6;C<*xA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