fix: 修复日志详情展示
This commit is contained in:
16
base.go
16
base.go
@ -287,22 +287,14 @@ func (b *BaseDao[DatabaseDataType, DatabaseTableColumns]) Columns() DatabaseTabl
|
||||
|
||||
// DetailForAny 查询任意表数据详情
|
||||
func (b *BaseDao[DatabaseDataType, DatabaseTableColumns]) DetailForAny(tx *gorm.DB, tableName string, result any, optionList ...define.SetOption) error {
|
||||
tx = tx.Model(&gorm.Model{}).Table(tableName)
|
||||
tx = tx.Table(tableName)
|
||||
tx = b.setTxCondition(tx, optionList...)
|
||||
return tx.Model(&IgnoreData{}).First(result).Error
|
||||
return tx.First(result).Error
|
||||
}
|
||||
|
||||
// ListForAny 查询任意表数据列表
|
||||
func (b *BaseDao[DatabaseDataType, DatabaseTableColumns]) ListForAny(tx *gorm.DB, tableName string, data any, optionList ...define.SetOption) error {
|
||||
tx = tx.Model(&gorm.Model{}).Table(tableName)
|
||||
tx = tx.Table(tableName)
|
||||
tx = b.setTxCondition(tx, optionList...)
|
||||
return tx.Model(&IgnoreData{}).Find(data).Error
|
||||
}
|
||||
|
||||
type IgnoreData struct {
|
||||
gorm.DB
|
||||
}
|
||||
|
||||
func (id IgnoreData) TableName() string {
|
||||
return "ignore"
|
||||
return tx.Find(data).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user