Skip to content

Commit 663ae5e

Browse files
committed
跳过多层结构解析
1 parent ded1677 commit 663ae5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

orm/orm.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ func (s *Stmt) Query(result interface{}) error {
278278
if sf.PkgPath != "" && !sf.Anonymous { // unexported
279279
continue
280280
}
281+
if sf.Type.Kind() == reflect.Slice {
282+
continue
283+
}
281284

282285
refs = append(refs, obj.Field(i).Field(j).Addr().Interface())
283286
}
@@ -309,7 +312,6 @@ func (s *Stmt) Query(result interface{}) error {
309312

310313
switch f.Tag.Get("db_table") {
311314
case "more":
312-
313315
//填充一对多结果,每次去查询
314316
if err = NewStmt(s.db, util.FieldEscape(f.Name)).addRelation(f.Name, s.firstTable(), id).Query(lr); err != nil {
315317
if errors.Cause(err) != meta.ErrNotFound {

0 commit comments

Comments
 (0)