nodejs搭配mysql数据库,代码如下:connection.query('select*fromreplyr,articleawherer.aid=a.aidandparentId=""',function(err,ress){if(err)console.log(err);else{varj=0;for(vari=0;i
2 回答
皈依舞
TA贡献1851条经验 获得超3个赞
用asyncasync=require('async');async.map(ress,function(item,callback){connection.query('select*fromreplywhereparentId="'+item.rid+'"',function(err,reply){if(err){returncallback(err);}item.reply=reply;returncallback(null,item);});},function(err,ress){returnconsole.log(ress);});
添加回答
举报
0/150
提交
取消