models/raw_silk_price_standard.go
@@ -49,8 +49,17 @@ return slf } func (slf *RawSilkPriceStandardSearch) SetId(id int) *RawSilkPriceStandardSearch { slf.ID = uint(id) return slf } func (slf *RawSilkPriceStandardSearch) build() *gorm.DB { db := slf.Orm.Table(slf.TableName()) if slf.ID > 0 { db = db.Where("id = ?", slf.ID) } return db } @@ -94,3 +103,13 @@ return nil } func (slf *RawSilkPriceStandardSearch) Delete() error { var db = slf.build() if err := db.Unscoped().Delete(&RawSilkPriceStandard{}).Error; err != nil { return err } return nil }