wangfei 6 vuotta sitten
vanhempi
commit
267dbd07fb
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2
    2
      models/course/course.go

+ 2
- 2
models/course/course.go Näytä tiedosto

@@ -613,7 +613,7 @@ func (m *CourseDAO) GetCourseCanUse(caseids string, page, pageSize int) ([]model
613 613
 	sql := `select * from ta_course where status=? and case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `') and course_id not in (
614 614
 		select course_id from ta_course_detail where begin_date<=NOW()
615 615
 	) order by create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + `, ` + strconv.Itoa(pageSize)
616
-	err := m.db.Sql(sql).Find(&courses)
616
+	err := m.db.Sql(sql, models.STATUS_NORMAL).Find(&courses)
617 617
 	// err := m.db.Where("status=?", models.STATUS_NORMAL).And("case_id in ('"+strings.Replace(caseids, ",", "','", -1)+"')").And("begin_date>NOW()").Desc("create_date").Limit(pageSize, (page-1)*pageSize).Find(&courses)
618 618
 	return courses, err
619 619
 }
@@ -624,7 +624,7 @@ func (m *CourseDAO) GetCourseCanUseCount(caseids string) (int, error) {
624 624
 	sql := `select * from ta_course where status=? and case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `') and course_id not in (
625 625
 		select course_id from ta_course_detail where begin_date<=NOW()
626 626
 	)`
627
-	err := m.db.Sql(sql).Find(&courses)
627
+	err := m.db.Sql(sql, models.STATUS_NORMAL).Find(&courses)
628 628
 	// err := m.db.Where("status=?", models.STATUS_NORMAL).And("case_id in ('" + strings.Replace(caseids, ",", "','", -1) + "')").And("begin_date>NOW()").Find(&courses)
629 629
 	return len(courses), err
630 630
 }