Add count where condition 'deleted' at 'is null

This commit is contained in:
zhangwenjian
2020-05-14 22:38:22 +08:00
parent 68d3ce0a22
commit 1bb0eb150d
7 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ func (e *{{.ClassName}}) GetPage(pageSize int, pageIndex int) ([]{{.ClassName}},
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
return nil, 0, err
}
table.Count(&count)
table.Where("`deleted_at` IS NULL").Count(&count)
return doc, count, nil
}