...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
const _ = require('lodash');
|
|
|
const moment = require('moment');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const STEP = 5;// eslint-disable-line
|
|
|
const STEP = 5;
|
|
|
|
|
|
class SeoIndexModel extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
...
|
...
|
@@ -11,14 +11,16 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
|
|
|
searchMipHandle(params) {
|
|
|
let products = [];
|
|
|
let page = ((params.page || 1) - 1) * STEP + 1;
|
|
|
|
|
|
// (page-1) * STEP + 1
|
|
|
params.limit = params.limit > 100 ? 100 : params.limit;
|
|
|
|
|
|
return Promise.all([
|
|
|
this.searchList(params)
|
|
|
|
|
|
// this.searchList(params),
|
|
|
// this.searchList(params)
|
|
|
this.searchList(Object.assign({}, params, {page: page})),
|
|
|
this.searchList(Object.assign({}, params, {page: page + 1})),
|
|
|
this.searchList(Object.assign({}, params, {page: page + 2})),
|
|
|
this.searchList(Object.assign({}, params, {page: page + 3})),
|
|
|
this.searchList(Object.assign({}, params, {page: page + 4}))
|
|
|
]).then(rdata => {
|
|
|
let productLists = [];
|
|
|
|
...
|
...
|
@@ -41,7 +43,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
});
|
|
|
|
|
|
products.push({
|
|
|
loc: `https://m.yohobuy.com/product/${item.product_skn}.html`,
|
|
|
loc: `https://www.yohobuy.com`,
|
|
|
lastmod: moment.unix(item.edit_time).format('YYYY-MM-DD'),
|
|
|
changefreq: 'weekly',
|
|
|
priority: 1.0,
|
...
|
...
|
@@ -66,24 +68,24 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
isFreightFree: 1,
|
|
|
commentCount: '', // 评论总数
|
|
|
deliveryPlace: {
|
|
|
administrativeAreaLv1: '' // 发货地
|
|
|
administrativeAreaLv1: '江苏' // 发货地
|
|
|
},
|
|
|
stockSpecification: {// 分地域库存信息
|
|
|
AdministrativeAreaLv2: '', // 区域
|
|
|
AdministrativeAreaLv2: '南京', // 区域
|
|
|
volume: item.storage_num, // 库存
|
|
|
status: (item.storage_num <= 0 ? 'outstock' : 'instock')
|
|
|
},
|
|
|
shelfSpecification: {// 分地域上下架具体信息
|
|
|
AdministrativeAreaLv2: '',
|
|
|
status: ''
|
|
|
AdministrativeAreaLv2: '南京',
|
|
|
status: 1
|
|
|
},
|
|
|
purchaseMethod: item.tags && item.tags['is_presell'] ? '付费预约' : '直接购买', // eslint-disable-line
|
|
|
coupon: [] // 优惠券
|
|
|
},
|
|
|
structuredCategory: {
|
|
|
categoryLv1: '',
|
|
|
categoryLv2: '',
|
|
|
categoryLv3: '',
|
|
|
categoryLv2: item.middle_sort_name,
|
|
|
categoryLv3: item.small_sort_name,
|
|
|
categoryLv4: ''
|
|
|
},
|
|
|
exifData: {
|
...
|
...
|
|