Add count where condition 'deleted' at 'is null
This commit is contained in:
1 parent
68d3ce0a22
commit
1bb0eb150d
7 files changed
+7
-7
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user