Commit 47493325 authored by strong's avatar strong

Merge branch 'newfunc_1009_memberlevel' into SANDBOX

parents 66dcbfb6 8ab47f24
...@@ -37,26 +37,25 @@ exports.loadLevel=function(ent_code,items,callback){ ...@@ -37,26 +37,25 @@ exports.loadLevel=function(ent_code,items,callback){
} }
}, function(e, r, body) { }, function(e, r, body) {
if (body && body.data) { if (body && body.data) {
console.log(body.data); //console.log(body.data);
_.forEach(items, function(d, i) { _.forEach(items, function(d, i) {
if (items[i].toObject) { if (items[i].toObject) {
items[i] = items[i].toObject(); items[i] = items[i].toObject();
} }
_.forEach(body.data, function(r, j) { _.forEach(body.data, function(r, j) {
if(d.from && d.from.uid === r.user.openId){
if(d.from && d.from.uid === r.user.id){
items[i].from.exp = r.exp; items[i].from.exp = r.exp;
} }
if(d.to && d.to.uid === r.user.id){ if(d.to && d.to.uid === r.user.openId){
items[i].to.exp = r.exp; items[i].to.exp = r.exp;
} }
if(d.commentLevel1From && d.commentLevel1From.uid === r.user.id){ if(d.commentLevel1From && d.commentLevel1From.uid === r.user.openId){
items[i].commentLevel1From.exp = r.exp; items[i].commentLevel1From.exp = r.exp;
} }
if(d.commentLevel2From && d.commentLevel2From.uid === r.user.id){ if(d.commentLevel2From && d.commentLevel2From.uid === r.user.openId){
items[i].commentLevel2From.exp = r.exp; items[i].commentLevel2From.exp = r.exp;
} }
if(d.commentLevel2ThreadFrom && d.commentLevel2ThreadFrom.uid === r.user.id){ if(d.commentLevel2ThreadFrom && d.commentLevel2ThreadFrom.uid === r.user.openId){
items[i].commentLevel2ThreadFrom.exp = r.exp; items[i].commentLevel2ThreadFrom.exp = r.exp;
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment