search.js
531 Bytes
/**
* 商品搜索controller
* @author: sefon
* @date: 2016-7-12 10:09:25
*/
'use strict';
const mRoot = '../models';
const search = require(`${mRoot}/search`);
/**
* search 首页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.index = (req, res, next) => {
let resData = {};
search.getSearchData(req.query).then(result => {
Object.assign(resData, result);
res.render('search/index', resData);
}).catch(next);
};