Commit b67d986f authored by 李硕's avatar 李硕

try 提交

parent 10462678
...@@ -44,37 +44,38 @@ const findWinnerInfoList = async (context) => { ...@@ -44,37 +44,38 @@ const findWinnerInfoList = async (context) => {
if (!activityId) { if (!activityId) {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少activityId`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少activityId`);
} }
let rankopenprizeService = new RankopenprizeService(context);
let total = await rankopenprizeService.getAwardslistCount(activityId);
console.log("totle=========", total);
let awardslist = [];
let awardMore = await rankopenprizeService.getAwardslistByActivityId(
activityId,
pageSize,
pageNo
);
awardslist = awardslist.concat(awardMore);
// console.log('awardslist>>>>', awardslist)
// awardslist = await rankopenprizeService.getAwardslistByActivityId(
// activityId,
// );
// console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist.map((item) => {
let ad = item.province + item.city + item.area + item.addressDetail, type0 = item.type;
item.prizeId = item._id;
item.createTime = formatTime(new Date(item.createTime + EIGHT_HOURS)) || "";
item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime + EIGHT_HOURS)) : '未填';
item.prizeDataType = prizePoolType[item.prizeDataType];
item.type = prizeKind[item.type];
item.receiveName = type0 == 3 ? (item.receiveName || "未填") : '/';
item.phone = type0 == 3 ? (item.phone || "未填") : '/';
item.address = type0 == 3 ? (item.province ? ad : "未填") : '/';
item.shipStatus = type0 == 3 ? (shipMsg[item.shipStatus]) : '/';
item.shipCompany = type0 == 3 ? (item.shipCompany || '/') : '/';
item.shipNum = type0 == 3 ? (item.shipNum || '/') : '/';
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
try { try {
let rankopenprizeService = new RankopenprizeService(context);
let total = await rankopenprizeService.getAwardslistCount(activityId);
console.log("totle=========", total);
let awardslist = [];
let awardMore = await rankopenprizeService.getAwardslistByActivityId(
activityId,
pageSize,
pageNo
);
awardslist = awardslist.concat(awardMore);
// console.log('awardslist>>>>', awardslist)
// awardslist = await rankopenprizeService.getAwardslistByActivityId(
// activityId,
// );
// console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist.map((item) => {
let ad = item.province + item.city + item.area + item.addressDetail, type0 = item.type;
item.prizeId = item._id;
item.createTime = formatTime(new Date(item.createTime + EIGHT_HOURS)) || "";
item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime + EIGHT_HOURS)) : '未填';
item.prizeDataType = prizePoolType[item.prizeDataType];
item.type = prizeKind[item.type];
item.receiveName = type0 == 3 ? (item.receiveName || "未填") : '/';
item.phone = type0 == 3 ? (item.phone || "未填") : '/';
item.address = type0 == 3 ? (item.province ? ad : "未填") : '/';
item.shipStatus = type0 == 3 ? (shipMsg[item.shipStatus]) : '/';
item.shipCompany = type0 == 3 ? (item.shipCompany || '/') : '/';
item.shipNum = type0 == 3 ? (item.shipNum || '/') : '/';
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
return resultsModel.success({ list: awardslist, total }); return resultsModel.success({ list: awardslist, total });
} catch (e) { } catch (e) {
console.log("上传文件出错", e); console.log("上传文件出错", e);
...@@ -315,60 +316,61 @@ const findWinnerInfoListBySearch = async (context) => { ...@@ -315,60 +316,61 @@ const findWinnerInfoListBySearch = async (context) => {
if (!prizeId && !userNick && !timeStart && !timeEnd && !shipStatus && !prizeType && !prizeDataType) { if (!prizeId && !userNick && !timeStart && !timeEnd && !shipStatus && !prizeType && !prizeDataType) {
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `未填写筛选信息`); return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `未填写筛选信息`);
} }
let rankopenprizeService = new RankopenprizeService(context);
console.log("activityId----", activityId, "prizeId---", prizeId, "userNick---", userNick, "timeStart---", timeStart, "timeEnd---", timeEnd, shipStatus);
// 获取活动中奖列表
let total = await rankopenprizeService.getTotalObjectCount(activityId, prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType, prizeDataType);
console.log("totle=========", total);
let awardslist = [];
if (total > 10) {
let totalPage = Math.ceil(total / pageSize);
let awardMore = await rankopenprizeService.getUserPrizeByActivityId(
activityId,
pageNo,
pageSize,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType
);
// console.list()
awardslist = awardslist.concat(awardMore);
} else {
awardslist = await rankopenprizeService.getUserPrizeByActivityId(
activityId,
pageNo,
pageSize,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType
);
console.log('awardslist>>>>', awardslist)
}
console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist.map((item) => {
let ad = item.province + item.city + item.area + item.addressDetail, type0 = item.type;
item.prizeId = item._id;
item.createTime = formatTime(new Date(item.createTime + EIGHT_HOURS)) || "";
item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime + EIGHT_HOURS)) : '未填';
item.prizeDataType = prizePoolType[item.prizeDataType];
item.type = prizeKind[item.type];
item.receiveName = type0 == 3 ? (item.receiveName || "未填") : '/';
item.phone = type0 == 3 ? (item.phone || "未填") : '/';
item.address = type0 == 3 ? (item.province ? ad : "未填") : '/';
item.shipStatus = type0 == 3 ? (shipMsg[item.shipStatus]) : '/';
item.shipCompany = type0 == 3 ? (item.shipCompany || '/') : '/';
item.shipNum = type0 == 3 ? (item.shipNum || '/') : '/';
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
try { try {
let rankopenprizeService = new RankopenprizeService(context);
console.log("activityId----", activityId, "prizeId---", prizeId, "userNick---", userNick, "timeStart---", timeStart, "timeEnd---", timeEnd, shipStatus);
// 获取活动中奖列表
let total = await rankopenprizeService.getTotalObjectCount(activityId, prizeId, userNick, timeStart, timeEnd, shipStatus, prizeType, prizeDataType);
console.log("totle=========", total);
let awardslist = [];
if (total > 10) {
let totalPage = Math.ceil(total / pageSize);
let awardMore = await rankopenprizeService.getUserPrizeByActivityId(
activityId,
pageNo,
pageSize,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType
);
// console.list()
awardslist = awardslist.concat(awardMore);
} else {
awardslist = await rankopenprizeService.getUserPrizeByActivityId(
activityId,
pageNo,
pageSize,
prizeId,
userNick,
timeStart,
timeEnd,
shipStatus,
prizeType,
prizeDataType
);
console.log('awardslist>>>>', awardslist)
}
console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist.map((item) => {
let ad = item.province + item.city + item.area + item.addressDetail, type0 = item.type;
item.prizeId = item._id;
item.createTime = formatTime(new Date(item.createTime + EIGHT_HOURS)) || "";
item.receiveTime = item.receiveTime ? formatTime(new Date(item.receiveTime + EIGHT_HOURS)) : '未填';
item.prizeDataType = prizePoolType[item.prizeDataType];
item.type = prizeKind[item.type];
item.receiveName = type0 == 3 ? (item.receiveName || "未填") : '/';
item.phone = type0 == 3 ? (item.phone || "未填") : '/';
item.address = type0 == 3 ? (item.province ? ad : "未填") : '/';
item.shipStatus = type0 == 3 ? (shipMsg[item.shipStatus]) : '/';
item.shipCompany = type0 == 3 ? (item.shipCompany || '/') : '/';
item.shipNum = type0 == 3 ? (item.shipNum || '/') : '/';
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
return resultsModel.success({ list: awardslist, total }); return resultsModel.success({ list: awardslist, total });
} catch (e) { } catch (e) {
console.log("上传文件出错", e); console.log("上传文件出错", e);
......
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