Commit f164bad3 by lixinming

no message

parent d0f8cfc9
...@@ -83,13 +83,20 @@ export async function homePage() { ...@@ -83,13 +83,20 @@ export async function homePage() {
// id, name, time:moment(st).format("YYYY-MM-DD") // id, name, time:moment(st).format("YYYY-MM-DD")
// }); // });
// }); // });
let huoDongTongZhiSelectList = [ARTICLEPOSITION.通知公告_hgh活动通知, ARTICLEPOSITION.通知公告_hgh会议通知, ARTICLEPOSITION.通知公告_hgh项目公告];
let huoDongTongZhiDataFindParam = {articleType:{"$in":[ARTICLEPOSITION.通知公告_hgh活动通知, ARTICLEPOSITION.通知公告_hgh会议通知, ARTICLEPOSITION.通知公告_hgh项目公告]}, display:STATE.}; let huoDongTongZhiDataFindParam = {articleType:{"$in":huoDongTongZhiSelectList}, display:STATE.};
let huoDongTongZhiDataList = await findToSortToPage(TABLEENUM.文章管理, huoDongTongZhiDataFindParam, ["articleTime", "id", "title", "articleType"], {articleTime:-1}, 1); let huoDongTongZhiDataList = await findToSortToPage(TABLEENUM.文章管理, huoDongTongZhiDataFindParam, ["articleTime", "id", "title", "articleType"], {articleTime:-1}, 1);
huoDongTongZhiDataList.forEach(info => { huoDongTongZhiDataList.forEach(info => {
let { id, title, articleTime, articleType } = info; let { id, title, articleTime, articleType } = info;
let value = 9;
for (let i= 0; i < articleType.length; i++) {
if (huoDongTongZhiSelectList.indexOf(articleType[i]) > -1) {
value = articleType[i];
break;
}
}
result.huoDongTongZhi.push({ result.huoDongTongZhi.push({
id, title, articleTime:moment(articleTime).format("YYYY-MM-DD"), value:articleType[0] id, title, articleTime:moment(articleTime).format("YYYY-MM-DD"), value
}); });
}); });
...@@ -604,9 +611,12 @@ export async function tongZhiGongGaoInfo({id, type}) { ...@@ -604,9 +611,12 @@ export async function tongZhiGongGaoInfo({id, type}) {
let findParam = {id, articleType:{"$in":[type]}, display:STATE.}; let findParam = {id, articleType:{"$in":[type]}, display:STATE.};
let dataBaseInfo = await findOnce(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "imgUrl", "articleTime" ]); let dataBaseInfo = await findOnce(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "imgUrl", "articleTime" ]);
dataBaseInfo.articleTime = moment(dataBaseInfo.articleTime).format("YYYY-MM-DD"); if (!dataBaseInfo || !dataBaseInfo.id ) throw new BizError(ERRORENUM.源文章已被删除);
let dataInfo:any = extractData(dataBaseInfo, ["id", "title", "desc", "imgUrl", "articleTime"]);
dataInfo.articleTime = moment(dataBaseInfo.articleTime).format("YYYY-MM-DD");
return {dataInfo:dataBaseInfo}; return {dataInfo};
} }
......
...@@ -52,7 +52,8 @@ export enum ERRORENUM { ...@@ -52,7 +52,8 @@ export enum ERRORENUM {
该手机号已被注册, 该手机号已被注册,
不存在该手机号的账号, 不存在该手机号的账号,
该动态未开放, 该动态未开放,
找不到该机构 找不到该机构,
源文章已被删除
} }
export enum ERRORCODEENUM { export enum ERRORCODEENUM {
......
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