mirror of
https://github.com/nkanaev/yarr.git
synced 2025-07-09 00:10:09 +00:00
fever with_ids fix
This commit is contained in:
parent
9b9addf3e6
commit
790a275443
@ -3,10 +3,10 @@ package storage
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
xhtml "golang.org/x/net/html"
|
|
||||||
"html"
|
"html"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
xhtml "golang.org/x/net/html"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ItemStatus int
|
type ItemStatus int
|
||||||
@ -143,9 +143,15 @@ func listQueryPredicate(filter ItemFilter) (string, []interface{}) {
|
|||||||
args = append(args, strings.Join(terms, " "))
|
args = append(args, strings.Join(terms, " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
if filter.IDs != nil {
|
if filter.IDs != nil && len(*filter.IDs) > 0 {
|
||||||
cond = append(cond, "i.id in ?")
|
qmarks := make([]string, len(*filter.IDs))
|
||||||
args = append(args, filter.IDs)
|
idargs := make([]interface{}, len(*filter.IDs))
|
||||||
|
for i, id := range *filter.IDs {
|
||||||
|
qmarks[i] = "?"
|
||||||
|
idargs[i] = id
|
||||||
|
}
|
||||||
|
cond = append(cond, "i.id in (" + strings.Join(qmarks, ",") + ")")
|
||||||
|
args = append(args, idargs...)
|
||||||
}
|
}
|
||||||
if filter.SinceID != nil {
|
if filter.SinceID != nil {
|
||||||
cond = append(cond, "i.id > ?")
|
cond = append(cond, "i.id > ?")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user