This commit is contained in:
xing 2023-02-26 22:03:30 +08:00
parent 477d8fe6f9
commit 5ae0ad646e

View File

@ -50,21 +50,22 @@ func pagination[T Model](db dbQuery, ctx context.Context, q QueryCondition) (r [
} }
q.Offset = offset q.Offset = offset
m := ctx.Value("handle=>") m := ctx.Value("handle=>")
if m != nil { if m == nil {
mm, ok := m.(string) r, err = finds[T](db, ctx, q)
if ok && mm == "toMap" { return
v := ctx.Value("map") }
mx, er := findToStringMap[T](db, ctx, q) mm, ok := m.(string)
if er != nil { if ok && mm == "toMap" {
err = er v := ctx.Value("map")
return mx, er := findToStringMap[T](db, ctx, q)
} if er != nil {
vv := v.(*[]map[string]string) err = er
*vv = mx
return return
} }
vv := v.(*[]map[string]string)
*vv = mx
return
} }
r, err = finds[T](db, ctx, q)
return return
} }