Enhance GetAssistants filtering to include locales
- Updated the GetAssistants method to allow filtering by locales in addition to keywords in name and description. - Improved query flexibility for retrieving assistants based on multiple criteria, enhancing user search capabilities.
This commit is contained in:
parent
ff41c6555d
commit
af383dd941
1 changed files with 2 additions and 1 deletions
|
|
@ -303,7 +303,8 @@ func (conv *Xun) GetAssistants(filter types.AssistantFilter, locale ...string) (
|
|||
if filter.Keywords != "" {
|
||||
qb.Where(func(qb query.Query) {
|
||||
qb.Where("name", "like", fmt.Sprintf("%%%s%%", filter.Keywords)).
|
||||
OrWhere("description", "like", fmt.Sprintf("%%%s%%", filter.Keywords))
|
||||
OrWhere("description", "like", fmt.Sprintf("%%%s%%", filter.Keywords)).
|
||||
OrWhere("locales", "like", fmt.Sprintf("%%%s%%", filter.Keywords))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue