Authored by 陈峰

commit

... ... @@ -420,4 +420,65 @@
{"productId": 9982, "yhId": 10000869},
{"productId": 14533, "yhId": 10005919},
{"productId": 12959, "yhId": 10002683},
{"productId": 10459, "yhId": 10000173}]
\ No newline at end of file
{"productId": 10459, "yhId": 10000173},
{"productId": 19142, "yhId": 10006051},
{"productId": 19127, "yhId": 10006049},
{"productId": 19135, "yhId": 10006047},
{"productId": 11914, "yhId": 10006119},
{"productId": 18806, "yhId": 10006107},
{"productId": 19476, "yhId": 10006073},
{"productId": 18167, "yhId": 10006055},
{"productId": 19040, "yhId": 10006057},
{"productId": 19902, "yhId": 10006123},
{"productId": 14012, "yhId": 10002845},
{"productId": 15701, "yhId": 10000617},
{"productId": 19310, "yhId": 10006081},
{"productId": 19877, "yhId": 10006133},
{"productId": 19114, "yhId": 10006131},
{"productId": 19455, "yhId": 10006153},
{"productId": 21212, "yhId": 10006297},
{"productId": 19309, "yhId": 10006227},
{"productId": 19847, "yhId": 10006219},
{"productId": 18177, "yhId": 10006221},
{"productId": 20069, "yhId": 10006205},
{"productId": 20991, "yhId": 10006199},
{"productId": 21079, "yhId": 10006197},
{"productId": 21172, "yhId": 10006195},
{"productId": 21169, "yhId": 10006193},
{"productId": 22188, "yhId": 10007303},
{"productId": 22111, "yhId": 10007249},
{"productId": 21432, "yhId": 10007165},
{"productId": 21982, "yhId": 10006903},
{"productId": 22182, "yhId": 10006885},
{"productId": 21872, "yhId": 10006869},
{"productId": 21763, "yhId": 10006853},
{"productId": 21273, "yhId": 10006829},
{"productId": 21977, "yhId": 10006741},
{"productId": 21787, "yhId": 10006731},
{"productId": 21794, "yhId": 10006717},
{"productId": 21765, "yhId": 10006689},
{"productId": 21769, "yhId": 10006687},
{"productId": 21286, "yhId": 10006685},
{"productId": 21662, "yhId": 10006683},
{"productId": 21302, "yhId": 10006561},
{"productId": 21570, "yhId": 10006559},
{"productId": 21269, "yhId": 10006325},
{"productId": 21767, "yhId": 10006317},
{"productId": 21766, "yhId": 10006315},
{"productId": 20286, "yhId": 10006305},
{"productId": 19849, "yhId": 10006237},
{"productId": 19878, "yhId": 10006233},
{"productId": 20868, "yhId": 10006231},
{"productId": 21445, "yhId": 10006215},
{"productId": 21655, "yhId": 10006213},
{"productId": 21078, "yhId": 10006203},
{"productId": 19632, "yhId": 10006139},
{"productId": 19602, "yhId": 10006137},
{"productId": 22331, "yhId": 10007379},
{"productId": 21795, "yhId": 10007615},
{"productId": 22256, "yhId": 10007563},
{"productId": 22275, "yhId": 10007511},
{"productId": 22394, "yhId": 10007473},
{"productId": 22411, "yhId": 10007445},
{"productId": 21991, "yhId": 10007443},
{"productId": 16856, "yhId": 10007441}]
\ No newline at end of file
... ...
... ... @@ -2,8 +2,11 @@ const fs = require('fs');
const readline = require('readline');
const dayjs = require('dayjs');
const _ = require('lodash');
const date = process.argv[2];
const fr = fs.createReadStream(`/Data/logs/node/prices/${dayjs().format('YYYY-MM-DD')}.log`);
const fileName = date ? date.match(/--d=(.*)/)[1] : dayjs().format('YYYY-MM-DD');
const fr = fs.createReadStream(`/Data/logs/node/prices/${fileName}.log`);
const rl = readline.createInterface({
... ... @@ -11,16 +14,17 @@ const rl = readline.createInterface({
});
console.log('duid,sales,model,price');
const allProducts = [];
rl.on('line', line => {
allProducts.push(JSON.parse(line));
});
rl.on('close', () => {
_.take(_.orderBy(allProducts, 'soldNum', 'desc'), 300).forEach(product => {
rl.on('close', async() => {
const takes = _.take(_.orderBy(allProducts.filter(p => p.brandId !== 4981 && p.brandId !== 10065), 'soldNum', 'desc'), 300);
console.log('duid,sales,model,price');
takes.forEach(product => {
console.log(`${product.productId},${product.soldNum},${product.articleNumber},${parseInt(product.price / 100, 10)}`);
});
});
... ...
... ... @@ -108,7 +108,8 @@ const task = async(id) => {
soldNum,
articleNumber,
price,
title
title,
brandId: detail.brandId
};
}
};
... ...