@ -340,14 +340,14 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error) {
}
}
e := db . GetEngine ( ctx )
e := db . GetEngine ( ctx )
sess := e . Where ( cond )
sess := e . Where ( cond ) . Join ( "INNER" , "repository" , "`repository`.id = `action`.repo_id" )
opts . SetDefaultValues ( )
opts . SetDefaultValues ( )
sess = db . SetSessionPagination ( sess , & opts )
sess = db . SetSessionPagination ( sess , & opts )
actions := make ( [ ] * Action , 0 , opts . PageSize )
actions := make ( [ ] * Action , 0 , opts . PageSize )
if err := sess . Desc ( "created_unix" ) . Find ( & actions ) ; err != nil {
if err := sess . Desc ( "`action`. created_unix" ) . Find ( & actions ) ; err != nil {
return nil , fmt . Errorf ( "Find: %v" , err )
return nil , fmt . Errorf ( "Find: %v" , err )
}
}
@ -417,7 +417,7 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
}
}
if ! opts . IncludePrivate {
if ! opts . IncludePrivate {
cond = cond . And ( builder . Eq { "is_private" : false } )
cond = cond . And ( builder . Eq { "`action`. is_private" : false } )
}
}
if ! opts . IncludeDeleted {
if ! opts . IncludeDeleted {
cond = cond . And ( builder . Eq { "is_deleted" : false } )
cond = cond . And ( builder . Eq { "is_deleted" : false } )
@ -430,8 +430,8 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
} else {
} else {
dateHigh := dateLow . Add ( 86399000000000 ) // 23h59m59s
dateHigh := dateLow . Add ( 86399000000000 ) // 23h59m59s
cond = cond . And ( builder . Gte { "created_unix" : dateLow . Unix ( ) } )
cond = cond . And ( builder . Gte { "`action`. created_unix" : dateLow . Unix ( ) } )
cond = cond . And ( builder . Lte { "created_unix" : dateHigh . Unix ( ) } )
cond = cond . And ( builder . Lte { "`action`. created_unix" : dateHigh . Unix ( ) } )
}
}
}
}