Browse Source

Merge pull request 'fix-1656-patch1' (#1979) from fix-1656-patch1 into V20220415.patch

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1979
Reviewed-by: lewis <747342561@qq.com>
V20220415.patch
lewis 3 years ago
parent
commit
c9c7fff15b
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      models/cloudbrain.go
  2. +1
    -1
      routers/api/v1/repo/cloudbrain_dashboard.go

+ 2
- 2
models/cloudbrain.go View File

@@ -1629,12 +1629,12 @@ func CloudbrainAll(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) {
var err error
condition := "cloudbrain.user_id = `user`.id"
if len(opts.Keyword) == 0 {
count, err = sess.Where(cond).Count(new(Cloudbrain))
count, err = sess.Unscoped().Where(cond).Count(new(Cloudbrain))
} else {
lowerKeyWord := strings.ToLower(opts.Keyword)

cond = cond.And(builder.Or(builder.Like{"LOWER(cloudbrain.job_name)", lowerKeyWord}, builder.Like{"LOWER(cloudbrain.display_job_name)", lowerKeyWord}, builder.Like{"`user`.lower_name", lowerKeyWord}))
count, err = sess.Table(&Cloudbrain{}).Where(cond).
count, err = sess.Table(&Cloudbrain{}).Unscoped().Where(cond).
Join("left", "`user`", condition).Count(new(CloudbrainInfo))

}


+ 1
- 1
routers/api/v1/repo/cloudbrain_dashboard.go View File

@@ -23,7 +23,7 @@ func DownloadCloudBrainBoard(ctx *context.Context) {
_, total, err := models.CloudbrainAll(&models.CloudbrainsOptions{
ListOptions: models.ListOptions{
Page: page,
PageSize: 1,
PageSize: pageSize,
},
Type: models.TypeCloudBrainAll,
NeedRepoInfo: false,


Loading…
Cancel
Save