From f6ad9a8a820629c71ef6654468b31e0131879dbd Mon Sep 17 00:00:00 2001 From: chanoe <90238995+chanoe@users.noreply.github.com> Date: Thu, 3 Mar 2022 23:40:13 +0800 Subject: [PATCH] Fix/model (#39) * feat:(api) entity token ... * feat:(config) Service configuration, easy integration to tkeel * feat:(tools) swaggerJSON generate * style:code style for golangci-lint * fix(api): Compatible with tkeel api * fix(model):tenant list --- model/tenant.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/tenant.go b/model/tenant.go index 001ec7a..925dff9 100644 --- a/model/tenant.go +++ b/model/tenant.go @@ -49,10 +49,11 @@ func (o *Tenant) List(db *gorm.DB, where map[string]interface{}, page *Page, key if keywords != "" { db = db.Where("concat (id, title, remark) like ?", "%"+keywords+"%") } + db = db.Table(o.TableName()).Count(&total) if page != nil { db = FormatPage(db, page) } - err = db.Find(&tenants).Count(&total).Error + err = db.Find(&tenants).Error return }