|
|
@@ -29,19 +29,20 @@ func (c *Controller) GetAllCourse(r *ghttp.Request) {
|
|
|
|
|
|
if term := r.GetInt("Term"); term != 0 {
|
|
|
if where == "" {
|
|
|
- where = fmt.Sprintf(" Term LIKE '%%%v%%'", term)
|
|
|
+ where = fmt.Sprintf(" Term = %v", term)
|
|
|
} else {
|
|
|
- where += fmt.Sprintf(" AND Term LIKE '%%%v%%'", term)
|
|
|
+ where += fmt.Sprintf(" AND Term = %v", term)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if classId := r.GetInt("ClassId"); classId != 0 {
|
|
|
if where == "" {
|
|
|
- where = fmt.Sprintf(" ClassId LIKE '%%%v%%'", classId)
|
|
|
+ where = fmt.Sprintf(" ClassId = %v", classId)
|
|
|
} else {
|
|
|
- where += fmt.Sprintf(" AND ClassId LIKE '%%%v%%'", classId)
|
|
|
+ where += fmt.Sprintf(" AND ClassId = %v", classId)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
var result []course.Entity
|
|
|
if err := course.GetAllCourse(page, where, &result); err != nil {
|
|
|
if err.Error() == "sql: no rows in result set" {
|