Blame view

apps/home/controllers/spread.js 567 Bytes
yyq authored
1 2 3 4 5 6 7 8 9 10
/**
 * 个人中心---我的推广
 * @author yyq <yanqing.yang@yoho.cn>
 */

'use strict';

const spreadModel = require('../models/spread');

exports.index = (req, res, next) => {
yyq authored
11
    req.ctx(spreadModel).getIndexData(req.user.uid, req.query.page).then(result => {
yyq authored
12 13 14 15 16 17
        res.render('spread', {
            page: 'spread',
            spread: result
        });
    }).catch(next);
};
yyq authored
18 19 20 21 22 23

exports.updateword = (req, res, next) => {
    req.ctx(spreadModel).updateTrendWord(req.user.uid, req.body.word).then(result => {
        res.send(result);
    }).catch(next);
};