上传装备锁定数据校验失败 却返回正常的问题
This commit is contained in:
parent
d999e6c81b
commit
5f0c222a21
@ -582,12 +582,15 @@ func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err er
|
||||
c *mongo.Cursor
|
||||
keys map[string]string
|
||||
tempdata map[string]string
|
||||
isfound bool
|
||||
)
|
||||
keys = make(map[string]string)
|
||||
if err = this.Redis.HGetAll(this.ukeylist(uid, id), data); err != nil && err != lgredis.RedisNil {
|
||||
return
|
||||
}
|
||||
isfound = true
|
||||
if err == lgredis.RedisNil {
|
||||
isfound = false
|
||||
if c, err = this.DB.Find(core.SqlTable(this.TableName), bson.M{"uid": uid}); err != nil {
|
||||
return err
|
||||
} else {
|
||||
@ -611,6 +614,7 @@ func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err er
|
||||
if tempdata, err = json.MarshalMap(data); err != nil {
|
||||
return
|
||||
}
|
||||
isfound = true
|
||||
}
|
||||
key := this.ukeylist(uid, _id)
|
||||
pipe.HMSetForMap(key, tempdata)
|
||||
@ -622,7 +626,10 @@ func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err er
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !isfound {
|
||||
err = fmt.Errorf("no found data table:%s uid:%s id:%s", this.TableName, uid, id)
|
||||
return
|
||||
}
|
||||
if this.Expired > 0 {
|
||||
childs := make(map[string]struct{}, len(keys))
|
||||
for _, v := range keys {
|
||||
|
Loading…
Reference in New Issue
Block a user