| | |
| | | |
| | | func (slf *OperationDetailsSearch) Delete() error { |
| | | var db = slf.build() |
| | | return db.Delete(&OperationDetails{}).Error |
| | | return db.Unscoped().Delete(&OperationDetails{}).Error |
| | | } |
| | | |
| | | func (slf *OperationDetailsSearch) First() (*OperationDetails, error) { |
| | |
| | | |
| | | return records, nil |
| | | } |
| | | |
| | | func (slf *OperationDetailsSearch) FindAll() ([]*OperationDetails, error) { |
| | | var ( |
| | | records = make([]*OperationDetails, 0) |
| | | db = slf.build() |
| | | ) |
| | | |
| | | if err := db.Find(&records).Error; err != nil { |
| | | return records, fmt.Errorf("find records err: %v", err) |
| | | } |
| | | |
| | | return records, nil |
| | | } |