You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
condition := &po.SysRole{Name: "SUPER_ADMIN", NameCn: ""}
var record *entity.SysRole
if err := s.Ctx(ctx).Where(condition).Scan(&record); err != nil {
return nil, errs.NewOperateDBError(ctx, s.Table(), err)
}
update logic:
out := &po.SysRole{Type: "Business"}
if _, err := s.Ctx(ctx).Where(s.Columns().Name, name).Data(out).Update(); err != nil {
return errs.NewOperateDBError(ctx, s.Table(), err)
}
5. What did you expect to see?
Expect the condition only has the filed "name" which i set when I select with the po.SystemRole struct.
Expect to update the filed Type when I update with the po.SystemRole struct.
6. What did you see instead?
Actually the condition has all the fields of po.SystemRole.
Actually it update all the filed and set other fields to empty value.
The text was updated successfully, but these errors were encountered:
gqcn
added
bug
It is confirmed a bug, but don't worry, we'll handle it.
done
This issue is done, which may be release in next version.
labels
Dec 18, 2023
zhangyuyu
changed the title
'Omitempty' in orm tag is no longer take effect when select/update using struct
'Omitempty' in orm tag is no longer take effect when select/update/insert using struct
Dec 19, 2023
1. What version of
Go
and system type/arch are you using?go version go1.21.3 darwin/arm64
2. What version of
GoFrame
are you using?version change:go: upgraded github.com/gogf/gf/v2 v2.5.7-0.20231114121049-5580ac9475ae => v2.6.0-beta.0.20231214061831-33584506ab17
3. Can this issue be re-produced with the latest release?
yes, occurred in latest version which is 3358450
4. What did you do?
struct po.SystemRole:
select logic:
update logic:
5. What did you expect to see?
6. What did you see instead?
The text was updated successfully, but these errors were encountered: