submissions: fix operations CountSince model
This commit is contained in:
parent
5d259e20f2
commit
e3539d0f81
@ -56,7 +56,7 @@ func (env *Operations) Delete(ctx context.Context, id int32) error {
|
|||||||
|
|
||||||
func (env *Operations) CountSince(ctx context.Context, owner int64, since int64) (int64, error) {
|
func (env *Operations) CountSince(ctx context.Context, owner int64, since int64) (int64, error) {
|
||||||
var count int64
|
var count int64
|
||||||
if err := env.db.Where("owner = ? AND created_at > ?",owner,since).Count(&count).Error; err != nil {
|
if err := env.db.Model(&model.Operation{}).Where("owner = ? AND created_at > ?",owner,since).Count(&count).Error; err != nil {
|
||||||
return count, err
|
return count, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user