mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-12 01:14:45 +08:00
refactor: add path for find op
This commit is contained in:
parent
c49b78b863
commit
826b67210e
1 changed files with 3 additions and 0 deletions
|
@ -272,6 +272,9 @@ func (fs *FileService) ListFiles(userId int64, fquery *schemas.FileQuery) (*sche
|
|||
if fquery.ParentID != "" {
|
||||
query.Where("parent_id = ?", fquery.ParentID)
|
||||
}
|
||||
if fquery.ParentID == "" && fquery.Path != "" && fquery.Query == "" {
|
||||
query.Where("parent_id in (SELECT id FROM teldrive.get_file_from_path(?, ?))", fquery.Path, userId)
|
||||
}
|
||||
if fquery.Type != "" {
|
||||
query.Where("type = ?", fquery.Type)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue