| | |
| | | // 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"` // 机车号 |
| | | } |
| | | |
| | |
| | | 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 { |
| | |
| | | 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 { |