|
@@ -49,10 +49,10 @@ func AutoMerge(mg mongodb.MongodbSim, sess *httpsession.Session) (bool, error) {
|
|
|
|
|
|
thisNull, otherNull := func() (t, o bool) {
|
|
thisNull, otherNull := func() (t, o bool) {
|
|
t, o = true, true
|
|
t, o = true, true
|
|
- if len(*qutil.ObjToMap((*thisUser)["o_jy"])) > 2 || (*thisUser)["o_vipjy"] != nil {
|
|
|
|
|
|
+ if checNullkeyset((*qutil.ObjToMap((*thisUser)["o_jy"]))["a_key"]) || (*thisUser)["o_vipjy"] != nil {
|
|
t = false
|
|
t = false
|
|
}
|
|
}
|
|
- if len(*qutil.ObjToMap((*otherUser)["o_jy"])) > 2 || (*otherUser)["o_vipjy"] != nil {
|
|
|
|
|
|
+ if checNullkeyset((*qutil.ObjToMap((*otherUser)["o_jy"]))["a_key"]) || (*otherUser)["o_vipjy"] != nil {
|
|
o = false
|
|
o = false
|
|
}
|
|
}
|
|
if !t && !o { //账户都不为空
|
|
if !t && !o { //账户都不为空
|
|
@@ -104,6 +104,17 @@ func AutoMerge(mg mongodb.MongodbSim, sess *httpsession.Session) (bool, error) {
|
|
return true, nil
|
|
return true, nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func checNullkeyset(a_key interface{}) bool {
|
|
|
|
+ if a_key == nil {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ arr, ok := a_key.([]interface{})
|
|
|
|
+ if ok && len(arr) > 0 {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+}
|
|
|
|
+
|
|
func MergeData(mg mongodb.MongodbSim, saveRes, otherRes *map[string]interface{}) bool {
|
|
func MergeData(mg mongodb.MongodbSim, saveRes, otherRes *map[string]interface{}) bool {
|
|
for k, v := range *otherRes {
|
|
for k, v := range *otherRes {
|
|
if _, ok := (*saveRes)[k]; !ok {
|
|
if _, ok := (*saveRes)[k]; !ok {
|