Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into courseware

schedule_job
杨树明 5 years ago
commit de13e57534

@ -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

@ -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}")

@ -808,15 +808,14 @@ 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
if(status===0){
debugger
this.props.getcomponentdidmount()
this.props.showNotification(result.data.message);
}
@ -826,15 +825,14 @@ 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
if(status===0){
debugger
this.props.getcomponentdidmount()
this.props.showNotification(response.data.message);
}

Loading…
Cancel
Save