zj #31

Manually merged
asd merged 2 commits from zj into master 2019-12-06 09:10:42 +08:00
Showing only changes of commit ea74c739f6 - Show all commits

View File

@ -6,13 +6,14 @@ var articlefind = async (ctx, next) => {
await dbs.find("articlelists").then(async (res) => {
let num=0
articlelist = res.data
await dbs.find("articletag").then((res)=>{
await dbs.find("articletag").then( async (res)=>{
for(let i in articlelist){
for(let m in res.data){
// console.log(res.data[m].articleid,articlelist[i].num_key,res.data[m].tagid)
if(res.data[m].articleid==articlelist[i].num_key){
console.log(res.data[m].articleid,articlelist[i].num_key,res.data[m].tagid)
// console.log(res.data[m].articleid,articlelist[i].num_key,res.data[m].tagid)
// console.log(res.data[m].articleid)
// console.log(res.data[m].articleid,res.data[m].tagid)
// tags.push([res.data[m].articleid])
@ -24,10 +25,22 @@ var articlefind = async (ctx, next) => {
}
}
console.log(tags)
// console.log(tags)
}
await dbs.find("label").then((res)=>{
for(let i in articlelist){
for(let m in articlelist[i].tag){
console.log(articlelist[i].tag[m])
for(let n in res.data){
if(res.data[n].num_key==articlelist[i].tag[m]){
articlelist[i].tag[m]=res.data[n].lablename
}
}
}
}
})
})
ctx.body=articlelist