Commit bfc05f26 authored by 杨翌文's avatar 杨翌文

测试点赞记录

parent 618134ed
...@@ -195,24 +195,39 @@ router.get('/info/:fid/threads', function(req, res, next) { ...@@ -195,24 +195,39 @@ router.get('/info/:fid/threads', function(req, res, next) {
console.error(err); console.error(err);
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
} else { } else {
util.loadLevel(req.session.user.ent_code, results.items, function() {
redisPraiseLog.get(ent_code, user.getMobileUser(req), 'thread', function(error, docs) {
_.forEach(results.items, function(d, i) { _.forEach(results.items, function(d, i) {
if (results.items[i].toObject) { if (results.items[i].toObject) {
results.items[i] = results.items[i].toObject(); results.items[i] = results.items[i].toObject();
}
results.items[i].isPraise = false; results.items[i].isPraise = false;
for (var k = docs.length - 1; k >= 0; k--) {
if (results.items[i]._id == docs[k]) {
results.items[i].isPraise = true;
break;
} }
}; // results.items[i].isPraise = false;
// for (var k = docs.length - 1; k >= 0; k--) {
// if (results.items[i]._id == docs[k]) {
// results.items[i].isPraise = true;
// break;
// }
// };
}); });
res.json(_.assign(results, returnCode.SUCCESS)); res.json(_.assign(results, returnCode.SUCCESS));
}); // util.loadLevel(req.session.user.ent_code, results.items, function() {
}); // redisPraiseLog.get(ent_code, user.getMobileUser(req), 'thread', function(error, docs) {
// _.forEach(results.items, function(d, i) {
// if (results.items[i].toObject) {
// results.items[i] = results.items[i].toObject();
// }
// results.items[i].isPraise = false;
// for (var k = docs.length - 1; k >= 0; k--) {
// if (results.items[i]._id == docs[k]) {
// results.items[i].isPraise = true;
// break;
// }
// };
// });
// res.json(_.assign(results, returnCode.SUCCESS));
// });
// });
} }
}); });
} }
......
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