plusstar.js 883 Bytes
/**
 * 潮流优选
 * @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
 * @date: 2016/08/04
 */
'use strict';

const mRoot = '../models';
const _ = require('lodash');
const plusstarModel = require(`${mRoot}/plusstar`);

/**
 * 潮流优选首页
 */
exports.index = (req, res, next) => {
    plusstarModel.getAllChannels({}).then(result => {
        res.render('plusstar/index', {
            page: 'plusstar-index',
            result: result,
            title: '潮流优选'
        });
    }).catch(next);
};

/**
 * 潮流优选首页-资源位
 */
exports.resources = (req, res, next) => {
    let code = req.query.code || '';

    plusstarModel.getResources({
        content_code: code
    }).then(result => {
        res.render('plusstar/index', {
            page: 'plusstar-index',
            result: result,
            title: '潮流优选'
        });
    }).catch(next);
};