From c417f6a23b0a5750b97846b0251759603ce8b294 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Mar 2020 21:21:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 19c4e14f3..1887aee5a 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -998,7 +998,7 @@ module ExercisesHelper def has_comment? exercise_user, question_ids exercise_answer_ids = exercise_user.user.exercise_answers.where(exercise_question_id: question_ids).pluck(:id) exercise_shixun_answer_ids = exercise_user.user.exercise_shixun_answers.where(exercise_question_id: question_ids).pluck(:id) - exercise_user.commit_status == 1 && (exercise_user.exercise_user_scores.size > 0 || exercise_user.subjective_score >= 0.0 || + exercise_user.commit_status == 1 && (exercise_user.exercise_user_scores.size > 0 || ExerciseAnswerComment.where(exercise_answer_id: exercise_answer_ids).or(ExerciseAnswerComment.where(exercise_shixun_answer_id: exercise_shixun_answer_ids)).exists?) end end From 8aa9f99e90cdebb6b10591bcf3d08d19ef55fa70 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Mar 2020 21:23:09 +0800 Subject: [PATCH 2/4] =?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/services/users/shixun_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/users/shixun_service.rb b/app/services/users/shixun_service.rb index 7e95cda84..6b17ea379 100644 --- a/app/services/users/shixun_service.rb +++ b/app/services/users/shixun_service.rb @@ -99,9 +99,9 @@ class Users::ShixunService end case params[:category] - when 'study', 'collect' then + when 'study' then relations.order("myshixuns.#{sort_by} #{sort_direction}") - when 'manage' then + when 'manage', 'collect' then relations.order("shixuns.#{sort_by} #{sort_direction}") else relations.order("shixuns.#{sort_by} #{sort_direction}") From 84bb3bbf62a77764a52316f550f4c931d2b2d01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Mar 2020 21:46:53 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 25dcd3bd9..cb8d48a2a 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -808,10 +808,10 @@ class TPMBanner extends Component { setCollect=()=>{ - let id = this.props.match.params.shixunId; + let {shixunsDetails} = this.props; let url ="/collections.json"; axios.post(url,{ - container_id:id, + container_id:shixunsDetails.id, container_type:"Shixun" }).then((result)=>{ const status = result.data.status @@ -826,10 +826,10 @@ class TPMBanner extends Component { } cancelCollect=()=>{ - let id = this.props.match.params.shixunId; + let {shixunsDetails} = this.props; let url=`/collections/cancel.json`; axios.delete(url,{ data:{ - container_id:id, + container_id:shixunsDetails.id, container_type:"Shixun" }}).then((response) => { const status = response.data.status From 67dfe9fd2ad7dcd25eb52ad20dc497f53c3ab1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Mar 2020 21:47:52 +0800 Subject: [PATCH 4/4] . --- public/react/src/modules/tpm/TPMBanner.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index cb8d48a2a..6bceba17e 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -816,7 +816,6 @@ class TPMBanner extends Component { }).then((result)=>{ const status = result.data.status if(status===0){ - debugger this.props.getcomponentdidmount() this.props.showNotification(result.data.message); } @@ -834,7 +833,6 @@ class TPMBanner extends Component { }}).then((response) => { const status = response.data.status if(status===0){ - debugger this.props.getcomponentdidmount() this.props.showNotification(response.data.message); }