mirror of https://github.com/Xhofe/alist
fix: `whereInParent` when parent = "/" (#2706)
parent
7947ff1ae4
commit
cdc45630ae
|
@ -12,10 +12,12 @@ import (
|
|||
)
|
||||
|
||||
func whereInParent(parent string) *gorm.DB {
|
||||
if parent == "/" {
|
||||
return db.Where("1 = 1")
|
||||
}
|
||||
return db.Where(fmt.Sprintf("%s LIKE ?", columnName("parent")),
|
||||
fmt.Sprintf("%s/%%", parent)).
|
||||
Or(fmt.Sprintf("%s = ?", columnName("parent")),
|
||||
fmt.Sprintf("%s%%", parent))
|
||||
Or(fmt.Sprintf("%s = ?", columnName("parent")), parent)
|
||||
}
|
||||
|
||||
func CreateSearchNode(node *model.SearchNode) error {
|
||||
|
|
Loading…
Reference in New Issue