From 7d4cdbcf3d08724fcb8803b8ad6ee311c7850600 Mon Sep 17 00:00:00 2001 From: wuchao <1272174216@qq.com> Date: Fri, 29 Nov 2024 18:18:31 +0800 Subject: [PATCH] =?UTF-8?q?db=20=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/db_service/db_service.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/services/db_service/db_service.go b/app/services/db_service/db_service.go index b4e4b09..38862fd 100644 --- a/app/services/db_service/db_service.go +++ b/app/services/db_service/db_service.go @@ -16,13 +16,16 @@ import ( func DbList(request *backend.DbListRequest, page int, limit int) (count int64, DbListInfo []crondbmodel.CronDb, err error) { conn := builder.NewCond() if request.DbName != "" { - conn = conn.And(builder.Like{"DbName", request.DbName}) + conn = conn.And(builder.Like{"db_name", request.DbName}) } if request.DbType != "" { - conn = conn.And(builder.Like{"DbType", request.DbType}) + conn = conn.And(builder.Like{"db_type", request.DbType}) + } + if request.DbPermission != 0 { + conn = conn.And(builder.Eq{"db_permission": request.DbPermission}) } if request.Status != 0 { - conn = conn.And(builder.Eq{"Status": request.Status}) + conn = conn.And(builder.Eq{"status": request.Status}) } session := crondbmodel.GetInstance().GetDb().Where(conn) if page != 0 && limit != 0 {