Authored by 郝肖肖

'search.li'

'use strict';
const SeoIndexModel = require('./models/seo/index');
const index = (req, res) => {
res.render('seo/index');
return req.ctx(SeoIndexModel).searchMipHandle(res.query).then(result => {
res.render('seo/index', result);
});
};
module.exports = {
... ...
'use strict';
const _ = require('lodash');
class SeoIndexModel extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
searchMipHandle(params) {
return Promise.all([
this.searchList(params),
this.searchList(params),
this.searchList(params)
]).then(rdata => {
console.log(rdata, ' --- ');
return rdata;
});
}
searchList(params) {
params = _.assign({
limit: 60,
status: 1,
sales: 'Y',
stocknumber: 1,
method: 'app.search.li',
attribute_not: 2
}, params);
return this.get({
data: params,
param: {
cache: true
}
});
}
}
module.exports = SeoIndexModel;
... ...