From d2c5c4d3b7f99678b1e8a89f66cc715e1a32af57 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 18 Oct 2022 15:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0db=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/db/dbconn.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/db/dbconn.go b/sys/db/dbconn.go index 976929af4..fcb65a97d 100644 --- a/sys/db/dbconn.go +++ b/sys/db/dbconn.go @@ -701,8 +701,7 @@ func (this *DBModel) GetListFields(uid string, id string, data interface{}, fiel func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err error) { //defer log.Debug("DBModel GetListObj", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "id", Value: id}, log.Field{Key: "data", Value: data}) var ( - keys map[string]string - tempdata map[string]string + keys map[string]string ) keys = make(map[string]string) if err = this.Redis.HGetAll(this.ukeylist(uid, id), data); err != nil && err != lgredis.RedisNil { @@ -714,7 +713,7 @@ func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err er } else { pipe := this.Redis.RedisPipe(context.TODO()) key := this.ukeylist(uid, id) - pipe.HMSetForMap(key, tempdata) + pipe.HMSet(key, data) keys[id] = key pipe.HMSetForMap(this.ukey(uid), keys) if _, err = pipe.Exec(); err != nil {