Authored by 陈峰

commit

[{"productId": 26938, "yhId": 10010577},
{"productId": 23238, "yhId": 10010537},
{"productId": 15188, "yhId": 10010507},
{"productId": 15174, "yhId": 10013213},
{"productId": 12834, "yhId": 10011047},
{"productId": 12831, "yhId": 10010515},
{"productId": 12830, "yhId": 10010517},
{"productId": 12817, "yhId": 10010513},
{"productId": 12815, "yhId": 10010569},
{"productId": 12812, "yhId": 10010595},
{"productId": 12811, "yhId": 10010521},
{"productId": 12810, "yhId": 10010501},
{"productId": 12800, "yhId": 10011689},
{"productId": 12795, "yhId": 10011685},
{"productId": 12785, "yhId": 10011683},
{"productId": 12775, "yhId": 10011691},
{"productId": 12771, "yhId": 10010547},
{"productId": 11125, "yhId": 10010523}]
\ No newline at end of file
... ...
... ... @@ -3,6 +3,7 @@ const _ = require('lodash');
const spider = require('../libs/spider');
const report = require('../libs/report');
const sknsData = require('../data/skns.json');
const legoData = require('../data/lego.json');
const {mysqlPool} = require('../libs/mysql');
const {logger} = require('../libs/logger');
const {sendMessage} = require('../libs/influx-report');
... ... @@ -54,6 +55,15 @@ module.exports = async(time) => {
sizeList.forEach(s => {
if (_.isPlainObject(s.item) && s.item.price > 0) {
if (sizeList.length === 1) {
const isLego = legoData.some(lego => lego.productId === detail.productId);
if (isLego) {
s.size = 'F';
console.log(`is lego size = F, ${detail.productId}`);
}
}
const find = sizeRelation[s.size];
if (!find) {
... ...