...
|
...
|
@@ -51,36 +51,26 @@ const task = async(id) => { |
|
|
const result = await spider.spiderFetch(id);
|
|
|
|
|
|
if (result.status === 200) {
|
|
|
const {detail, sizeList} = result.data;
|
|
|
const {detail, item} = result.data;
|
|
|
|
|
|
const productId = detail.productId;
|
|
|
const soldNum = detail.soldNum;
|
|
|
const articleNumber = detail.articleNumber;
|
|
|
|
|
|
// const sizes = sizeList.map(sizeItem => {
|
|
|
// return {
|
|
|
// size: sizeItem.size,
|
|
|
// price: _.isEmpty(sizeItem.item) ? 0 : sizeItem.item.price,
|
|
|
// soldNum: 0
|
|
|
// };
|
|
|
// });
|
|
|
|
|
|
// const dest = await processBuys({
|
|
|
// productId,
|
|
|
// soldNum,
|
|
|
// sizes
|
|
|
// });
|
|
|
const price = item.price || 0 / 100;
|
|
|
const title = detail.title;
|
|
|
|
|
|
return {
|
|
|
productId,
|
|
|
soldNum,
|
|
|
articleNumber
|
|
|
articleNumber,
|
|
|
price,
|
|
|
title
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = async() => {
|
|
|
const now = dayjs().format('YYYY-MM-DD_HH');
|
|
|
const now = dayjs().format('YYYY-MM-DD');
|
|
|
const fw = fs.createWriteStream(`/Data/logs/node/prices/${now}.log`, {
|
|
|
flags: 'a'
|
|
|
});
|
...
|
...
|
|