|
@@ -152,7 +152,7 @@ func GetCalendarListCount(condition string, pars []interface{}) (count int, err
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetCalendarList(condition string, pars []interface{}, pageLimit ...int) (list []*CalendarListView, err error) {
|
|
|
+func GetCalendarList(condition string, pars []interface{}, status int, pageLimit ...int) (list []*CalendarListView, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM rs_calendar AS a
|
|
|
INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
|
|
@@ -160,7 +160,11 @@ func GetCalendarList(condition string, pars []interface{}, pageLimit ...int) (li
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
|
}
|
|
|
- sql += ` ORDER BY a.create_time DESC LIMIT ?,? `
|
|
|
+ if status==1 {
|
|
|
+ sql += ` ORDER BY a.create_time ASC LIMIT ?,? `
|
|
|
+ }else{
|
|
|
+ sql += ` ORDER BY a.create_time DESC LIMIT ?,? `
|
|
|
+ }
|
|
|
_, err = o.Raw(sql, pars, pageLimit).QueryRows(&list)
|
|
|
return
|
|
|
}
|