上传db代码修复
This commit is contained in:
parent
9a78cbbacf
commit
d2c5c4d3b7
@ -702,7 +702,6 @@ func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err er
|
|||||||
//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})
|
//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 (
|
var (
|
||||||
keys map[string]string
|
keys map[string]string
|
||||||
tempdata map[string]string
|
|
||||||
)
|
)
|
||||||
keys = make(map[string]string)
|
keys = make(map[string]string)
|
||||||
if err = this.Redis.HGetAll(this.ukeylist(uid, id), data); err != nil && err != lgredis.RedisNil {
|
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 {
|
} else {
|
||||||
pipe := this.Redis.RedisPipe(context.TODO())
|
pipe := this.Redis.RedisPipe(context.TODO())
|
||||||
key := this.ukeylist(uid, id)
|
key := this.ukeylist(uid, id)
|
||||||
pipe.HMSetForMap(key, tempdata)
|
pipe.HMSet(key, data)
|
||||||
keys[id] = key
|
keys[id] = key
|
||||||
pipe.HMSetForMap(this.ukey(uid), keys)
|
pipe.HMSetForMap(this.ukey(uid), keys)
|
||||||
if _, err = pipe.Exec(); err != nil {
|
if _, err = pipe.Exec(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user