master-nan

Results 1 issues of master-nan

## Your Question 我在BeforeUpdate钩子函数中有个需求想统一变更修改人字段,于是使用tx.Statement.SetColumn("modify_user", xxx)设置,但是出现了问题 ## The document you expected this should be explained 追踪了代码发现我调用Updates更新时传入的结构体是精简后的模型,不是表对应的结构体,那他会从Statement下的Model中获取下标,然后去Dest中找这个字段,这可能引发错误,因为我传入的修改结构体可能只是部分字段;当然了如果传入Updates的是map[string]interface{}并不存在这个问题 ## Expected answer destValue := reflect.ValueOf(stmt.Dest) for destValue.Kind() == reflect.Ptr { destValue = destValue.Elem() }...

type:question
status:stale