From c90e3d06b509a000ca1acf4a47a7b25d661db69f Mon Sep 17 00:00:00 2001 From: yfsoftcom Date: Thu, 20 Jan 2022 14:48:28 +0800 Subject: [PATCH] fix count issue --- plugins/dbImpl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dbImpl.go b/plugins/dbImpl.go index 1e1daa5..46533a0 100644 --- a/plugins/dbImpl.go +++ b/plugins/dbImpl.go @@ -216,7 +216,7 @@ func (p *ormImpl) FindObject(q *db.QueryData) (data []map[string]interface{}, er // err = dbclient.Model(Fake{}).Condition("name = ?", "c").Count(&total).Error() // total is the count func (p *ormImpl) Count(q *db.BaseData, total *int64) error { - return p.db.Table(q.Table).Where(q.Condition, q.Arguments...).Count(total).Error + return p.db.Table(q.Table).Where(fmt.Sprintf("(%s) and deleted_at is null", q.Condition, q.Arguments...).Count(total).Error } //OK