Browse Source

models/repo: modify keyword search to include description for #4287 (#4548)

* Modified repository keyword search to include description for #4287

* Replacing Where with And for #4548
pull/4551/head
Simon Dann 8 years ago committed by 无闻
parent
commit
e9a2b72ddb
  1. 2
      models/repo.go

2
models/repo.go

@ -1646,7 +1646,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int
} }
} }
if len(opts.Keyword) > 0 { if len(opts.Keyword) > 0 {
sess.And("repo.lower_name LIKE ?", "%"+strings.ToLower(opts.Keyword)+"%") sess.And("repo.lower_name LIKE ? OR repo.description LIKE ?", "%"+strings.ToLower(opts.Keyword)+"%", "%"+strings.ToLower(opts.Keyword)+"%")
} }
if opts.OwnerID > 0 { if opts.OwnerID > 0 {
sess.And("repo.owner_id = ?", opts.OwnerID) sess.And("repo.owner_id = ?", opts.OwnerID)

Loading…
Cancel
Save