Browse Source

增加模型状态过滤功能。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.9.2^2
zouap 3 years ago
parent
commit
0a86bbc6b0
2 changed files with 7 additions and 0 deletions
  1. +6
    -0
      models/ai_model_manage.go
  2. +1
    -0
      routers/repo/ai_model_manage.go

+ 6
- 0
models/ai_model_manage.go View File

@@ -374,6 +374,12 @@ func QueryModel(opts *AiModelQueryOptions) ([]*AiModelManage, int64, error) {
)
}

if (opts.Status) >= 0 {
cond = cond.And(
builder.Eq{"ai_model_manage.status": opts.Status},
)
}

count, err := sess.Where(cond).Count(new(AiModelManage))
if err != nil {
return nil, 0, fmt.Errorf("Count: %v", err)


+ 1
- 0
routers/repo/ai_model_manage.go View File

@@ -851,6 +851,7 @@ func QueryModelListForPredict(ctx *context.Context) {
RepoID: repoId,
Type: ctx.QueryInt("type"),
New: -1,
Status: 0,
})
if err != nil {
ctx.ServerError("Cloudbrain", err)


Loading…
Cancel
Save