解决后续data解析到空map为nil的问题
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
|||||||
service2 "github.com/ayflying/utility_go/service"
|
service2 "github.com/ayflying/utility_go/service"
|
||||||
"github.com/ayflying/utility_go/tools"
|
"github.com/ayflying/utility_go/tools"
|
||||||
"github.com/gogf/gf/v2/container/gset"
|
"github.com/gogf/gf/v2/container/gset"
|
||||||
|
"github.com/gogf/gf/v2/container/gvar"
|
||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
"github.com/gogf/gf/v2/os/gctx"
|
"github.com/gogf/gf/v2/os/gctx"
|
||||||
@@ -68,8 +69,8 @@ func (s *sGameAct) Info(uid int64, actId int) (data *g.Var, err error) {
|
|||||||
Uid: uid,
|
Uid: uid,
|
||||||
ActId: actId,
|
ActId: actId,
|
||||||
}).Fields("action").OrderDesc("updated_at").Value()
|
}).Fields("action").OrderDesc("updated_at").Value()
|
||||||
getDb.Scan(&data)
|
// getDb.Scan(&data)
|
||||||
|
data = gvar.New(getDb)
|
||||||
if data == nil || data.IsEmpty() {
|
if data == nil || data.IsEmpty() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user