mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 15:06:37 +08:00
feat: Add description field matching to application search (#10101)
Refs https://github.com/1Panel-dev/1Panel/issues/10071
This commit is contained in:
parent
5fd9d20f99
commit
acf27693b2
2 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ func (a AppRepo) WithByLikeName(name string) DBOption {
|
|||
if len(name) == 0 {
|
||||
return g
|
||||
}
|
||||
return g.Where("name like ? or short_desc_zh like ? or short_desc_en like ?", "%"+name+"%", "%"+name+"%", "%"+name+"%")
|
||||
return g.Where("name like ? or description like ? or short_desc_zh like ? or short_desc_en like ?", "%"+name+"%", "%"+name+"%", "%"+name+"%", "%"+name+"%")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ func (a AppService) PageApp(ctx *gin.Context, req request.AppSearch) (interface{
|
|||
var opts []repo.DBOption
|
||||
opts = append(opts, appRepo.OrderByRecommend())
|
||||
if req.Name != "" {
|
||||
opts = append(opts, appRepo.WithByLikeName(req.Name))
|
||||
opts = append(opts, appRepo.WithByLikeName(strings.TrimSpace(req.Name)))
|
||||
}
|
||||
if req.Type != "" {
|
||||
opts = append(opts, appRepo.WithType(req.Type))
|
||||
|
@ -100,7 +100,7 @@ func (a AppService) PageApp(ctx *gin.Context, req request.AppSearch) (interface{
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var appDTOs []*response.AppItem
|
||||
appDTOs := make([]*response.AppItem, 0)
|
||||
info := &dto.SettingInfo{}
|
||||
if req.Type == "php" {
|
||||
info, _ = NewISettingService().GetSettingInfo()
|
||||
|
|
Loading…
Add table
Reference in a new issue