From a5429b8a83e1b4a48c2a3b9b0b475f08a114837c Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期四, 20 六月 2024 09:11:57 +0800
Subject: [PATCH] download file by attach model

---
 models/text.go |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/models/text.go b/models/text.go
index bd9360a..cc4d724 100644
--- a/models/text.go
+++ b/models/text.go
@@ -190,7 +190,7 @@
 		db      = slf.build()
 	)
 
-	if err := db.Count(&total).Error; err != nil {
+	if err := db.Where("deleted_at IS NULL").Count(&total).Error; err != nil {
 		return records, int(total), fmt.Errorf("find count err: %v", err)
 	}
 	if slf.PageNum*slf.PageSize > 0 {
@@ -227,7 +227,7 @@
 		db      = slf.Orm.Table(slf.TableName()).Where(query, args...)
 	)
 
-	if err := db.Count(&total).Error; err != nil {
+	if err := db.Where("deleted_at IS NULL").Count(&total).Error; err != nil {
 		return records, total, fmt.Errorf("find by query count err: %v", err)
 	}
 	if slf.PageNum*slf.PageSize > 0 {

--
Gitblit v1.8.0