Commit 662442b9 by lixinming

no message

parent 2be982b4
...@@ -18,10 +18,14 @@ export async function banner() { ...@@ -18,10 +18,14 @@ export async function banner() {
/**banner */ /**banner */
let localBanners = [BANNERPOSITION.首页_hghbanner01, BANNERPOSITION.首页_hghbanner02, BANNERPOSITION.首页_hghbanner03]; let localBanners = [BANNERPOSITION.首页_hghbanner01, BANNERPOSITION.首页_hghbanner02, BANNERPOSITION.首页_hghbanner03];
let bannerData = await find(TABLEENUM.banner管理, {location:{"$in":localBanners}, display:STATE.} ); let bannerData = await find(TABLEENUM.banner管理, {location:{"$in":localBanners}, display:STATE.} );
bannerData.forEach(info => { for (let i= 0; i < bannerData.length; i++) {
let {imgUrl, articleTitle, desc, articleUrl} = info; let {imgUrl, articleTitle, desc, articleUrl} = bannerData[i];
result.bannerList.push({imgUrl, title:articleTitle, desc, articleUrl});
}); let articleInfo = await findOnce(TABLEENUM.文章管理, {id:articleTitle}, ["id", "title"]);
let articleTitleStr = articleInfo && articleInfo.id ? articleInfo.title : '';
result.bannerList.push({imgUrl, title:articleTitleStr, desc, articleUrl});
}
return result; return result;
} }
...@@ -98,10 +102,14 @@ export async function xueHuiGaiKuangBanner() { ...@@ -98,10 +102,14 @@ export async function xueHuiGaiKuangBanner() {
/**banner */ /**banner */
let localBanners = [BANNERPOSITION.学会概况_hghbanner01, BANNERPOSITION.学会概况_hghbanner02, BANNERPOSITION.学会概况_hghbanner03]; let localBanners = [BANNERPOSITION.学会概况_hghbanner01, BANNERPOSITION.学会概况_hghbanner02, BANNERPOSITION.学会概况_hghbanner03];
let bannerData = await find(TABLEENUM.banner管理, {location:{"$in":localBanners}, display:STATE.} ); let bannerData = await find(TABLEENUM.banner管理, {location:{"$in":localBanners}, display:STATE.} );
bannerData.forEach(info => { for (let i= 0; i < bannerData.length; i++) {
let {imgUrl, articleTitle, desc, articleUrl} = info; let {imgUrl, articleTitle, desc, articleUrl} = bannerData[i];
result.bannerList.push({imgUrl, title:articleTitle, desc, articleUrl});
}); let articleInfo = await findOnce(TABLEENUM.文章管理, {id:articleTitle}, ["id", "title"]);
let articleTitleStr = articleInfo && articleInfo.id ? articleInfo.title : '';
result.bannerList.push({imgUrl, title:articleTitleStr, desc, articleUrl});
}
return result; return result;
} }
...@@ -369,7 +377,8 @@ export async function zhuTiJiaoYu() { ...@@ -369,7 +377,8 @@ export async function zhuTiJiaoYu() {
let dataBaseList = await find(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "articleTime", "imgUrl"]); let dataBaseList = await find(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "articleTime", "imgUrl"]);
dataBaseList.forEach(item => { dataBaseList.forEach(item => {
let {id, title, desc, articleTime, imgUrl} = item; let {id, title, desc, articleTime, imgUrl} = item;
dataInfo[info.name].push({id, title, desc, articleTime, imgUrl}); let timeStr = moment(articleTime).format("YYYY-MM-DD")
dataInfo[info.name].push({id, title, desc, articleTime:timeStr, imgUrl});
}); });
} }
......
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