From 9f78e3b126b15a9b331c3a1a318da1ceea30114c Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期一, 29 七月 2024 16:15:52 +0800
Subject: [PATCH] export

---
 models/audio_text.go |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/models/audio_text.go b/models/audio_text.go
index e5e1f36..611d75c 100644
--- a/models/audio_text.go
+++ b/models/audio_text.go
@@ -10,9 +10,8 @@
 	// AudioText 闊抽鏂囨湰
 	AudioText struct {
 		gorm.Model
-		AudioID   uint    `gorm:"unique;type:int;not null;default:0;comment:闊抽id" json:"audioID"` // 闊抽id
-		AudioText string  `json:"audioText"`                                                      // 闊抽鏂囨湰
-		Score     float64 `json:"score"`                                                          // 缃俊搴�
+		AudioID   uint   `gorm:"unique;type:int;not null;default:0;comment:闊抽id" json:"audioID"` // 闊抽id
+		AudioText string `json:"audioText"`                                                      // 闊抽鏂囨湰
 	}
 
 	AudioTextSearch struct {
@@ -161,7 +160,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 {
@@ -198,7 +197,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