dsmzx
2024-06-14 c14c24cad0f8ec362cacc1368c115bb5b4de9744
models/attribute.go
@@ -57,6 +57,17 @@
   return nil
}
func (slf *Attribute) BeforeUpdate(tx *gorm.DB) (err error) {
   if len(slf.SelectValues) != 0 {
      bts, err := json.Marshal(slf.SelectValues)
      if err != nil {
         return err
      }
      slf.SelectValue = string(bts)
   }
   return nil
}
func (slf *Attribute) AfterFind(tx *gorm.DB) (err error) {
   if slf.SelectValue != "" {
      var list []string