跟新结构体切片

This commit is contained in:
ayflying
2025-02-11 14:26:06 +08:00
parent 9461ad77ed
commit 4862dcd1d8
3 changed files with 26 additions and 17 deletions

View File

@@ -93,7 +93,7 @@ func (s *Excel) itemsFormat(list []interface{}, Items []string) []interface{} {
for k3, v3 := range v2.(g.Map) {
if gstr.InArray(Items, k3) {
if _, ok := v3.(string); ok {
list[k2].(g.Map)[k3] = s.Spilt2Item(v3.(string))
list[k2].(g.Map)[k3] = Spilt2Item(v3.(string))
} else {
g.Log().Errorf(gctx.New(), "当前类型断言失败:%v,list=%v", v3, v2)
}
@@ -108,7 +108,7 @@ func (s *Excel) itemsMapFormat(list []interface{}, Items []string) []interface{}
for k3, v3 := range v2.(g.Map) {
if gstr.InArray(Items, k3) {
if _, ok := v3.(string); ok {
get := s.Spilt2Item(v3.(string))
get := Spilt2Item(v3.(string))
list[k2].(g.Map)[k3] = s.Items2Map(get)
} else {
g.Log().Errorf(gctx.New(), "当前类型断言失败:%v,list=%v", v3, v2)