文章标签111
This commit is contained in:
parent
998b86f8e3
commit
ea74c739f6
@ -6,13 +6,14 @@ var articlefind = async (ctx, next) => {
|
|||||||
await dbs.find("articlelists").then(async (res) => {
|
await dbs.find("articlelists").then(async (res) => {
|
||||||
let num=0
|
let num=0
|
||||||
articlelist = res.data
|
articlelist = res.data
|
||||||
await dbs.find("articletag").then((res)=>{
|
await dbs.find("articletag").then( async (res)=>{
|
||||||
|
|
||||||
for(let i in articlelist){
|
for(let i in articlelist){
|
||||||
|
|
||||||
for(let m in res.data){
|
for(let m in res.data){
|
||||||
// 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)
|
||||||
if(res.data[m].articleid==articlelist[i].num_key){
|
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)
|
||||||
// console.log(res.data[m].articleid,res.data[m].tagid)
|
// console.log(res.data[m].articleid,res.data[m].tagid)
|
||||||
// tags.push([res.data[m].articleid])
|
// 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
|
ctx.body=articlelist
|
||||||
|
Loading…
Reference in New Issue
Block a user