change layout
CI / changes (push) Successful in 5s
CI / docker-bff (push) Failing after 7s
CI / docker-product (push) Failing after 5s
CI / docker-admin (push) Failing after 4s
CI / docker-user (push) Failing after 6s

This commit is contained in:
2026-08-20 15:41:44 +08:00
parent 57e04be304
commit be8f89f449
176 changed files with 7009 additions and 4498 deletions
+4 -4
View File
@@ -1,12 +1,12 @@
package modelbase
import (
"encoding/json"
"errors"
"fmt"
"lone-services/pkg/utils"
jsoniter "github.com/json-iterator/go"
"gorm.io/gorm"
"pkg.local/utils"
)
const (
@@ -137,8 +137,8 @@ func (m Base) Create(data interface{}) error {
func (m Base) Edit(w Params, data interface{}) (int64, error) {
o := m.setWhere(w)
update := make(map[string]interface{})
jsonBytes, _ := json.Marshal(data)
_ = json.Unmarshal(jsonBytes, &update)
jsonBytes, _ := jsoniter.Marshal(data)
_ = jsoniter.Unmarshal(jsonBytes, &update)
ret := o.Updates(update)
return ret.RowsAffected, ignoreNotFound(ret.Error)
}