Authored by 陈峰

commit

  1 +[{"productId": 26938, "yhId": 10010577},
  2 + {"productId": 23238, "yhId": 10010537},
  3 + {"productId": 15188, "yhId": 10010507},
  4 + {"productId": 15174, "yhId": 10013213},
  5 + {"productId": 12834, "yhId": 10011047},
  6 + {"productId": 12831, "yhId": 10010515},
  7 + {"productId": 12830, "yhId": 10010517},
  8 + {"productId": 12817, "yhId": 10010513},
  9 + {"productId": 12815, "yhId": 10010569},
  10 + {"productId": 12812, "yhId": 10010595},
  11 + {"productId": 12811, "yhId": 10010521},
  12 + {"productId": 12810, "yhId": 10010501},
  13 + {"productId": 12800, "yhId": 10011689},
  14 + {"productId": 12795, "yhId": 10011685},
  15 + {"productId": 12785, "yhId": 10011683},
  16 + {"productId": 12775, "yhId": 10011691},
  17 + {"productId": 12771, "yhId": 10010547},
  18 + {"productId": 11125, "yhId": 10010523}]
@@ -3,6 +3,7 @@ const _ = require('lodash'); @@ -3,6 +3,7 @@ const _ = require('lodash');
3 const spider = require('../libs/spider'); 3 const spider = require('../libs/spider');
4 const report = require('../libs/report'); 4 const report = require('../libs/report');
5 const sknsData = require('../data/skns.json'); 5 const sknsData = require('../data/skns.json');
  6 +const legoData = require('../data/lego.json');
6 const {mysqlPool} = require('../libs/mysql'); 7 const {mysqlPool} = require('../libs/mysql');
7 const {logger} = require('../libs/logger'); 8 const {logger} = require('../libs/logger');
8 const {sendMessage} = require('../libs/influx-report'); 9 const {sendMessage} = require('../libs/influx-report');
@@ -54,6 +55,15 @@ module.exports = async(time) => { @@ -54,6 +55,15 @@ module.exports = async(time) => {
54 55
55 sizeList.forEach(s => { 56 sizeList.forEach(s => {
56 if (_.isPlainObject(s.item) && s.item.price > 0) { 57 if (_.isPlainObject(s.item) && s.item.price > 0) {
  58 +
  59 + if (sizeList.length === 1) {
  60 + const isLego = legoData.some(lego => lego.productId === detail.productId);
  61 +
  62 + if (isLego) {
  63 + s.size = 'F';
  64 + console.log(`is lego size = F, ${detail.productId}`);
  65 + }
  66 + }
57 const find = sizeRelation[s.size]; 67 const find = sizeRelation[s.size];
58 68
59 if (!find) { 69 if (!find) {