module.exports= {
getHomePost:function(req,res) {
post_model.getHomePosts('1',function(err,rows) {
var locals={};
async.parallel([
function(callback) {
for(var i=0;i<rows.length-1;i++) {
async.series([
function(call){
post_model.getPostDetails(rows[i].Post_Date_Time_id,rows[i].Post_Personid_id,function(err,row) {
locals.rows[]=row;
call();
});
}
],function(err){
//console.log(locals.rows);
});
}
callback();
}
],function(err) {
console.log(locals.rows);
res.render('home',locals);
});
});
}
}
“我想在从 for 循环获取输出后执行渲染。但我无法做到。请帮助。在从循环获取值之前,我的回调函数执行。但我想在从 for 循环获取输出后执行它"