From bcdc840ba903c07e95227dc8f4e37ac09702e73a Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 22 五月 2024 19:53:07 +0800 Subject: [PATCH] 音频列表增加状态搜索 --- models/text.go | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/text.go b/models/text.go index 1818ee0..cc4d724 100644 --- a/models/text.go +++ b/models/text.go @@ -10,7 +10,7 @@ // Word 鏂囧瓧 Word struct { gorm.Model - Content string `gorm:"uniqueIndex:locomotive_number_Word;type:varchar(255);not null;default:'';comment:闊抽鍚嶇О" json:"content"` // 鏂囧瓧 + Content string `gorm:"uniqueIndex:locomotive_number_Word;type:varchar(255);not null;default:'';comment:鏂囧瓧" json:"content"` // 鏂囧瓧 LocomotiveNumber string `gorm:"uniqueIndex:locomotive_number_Word;type:varchar(255);not null;default:'';comment:鏈鸿溅鍙�" json:"locomotiveNumber"` // 鏈鸿溅鍙� } @@ -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