Showing
1 changed file
with
30 additions
and
0 deletions
apps/home/controllers/qrcode.js
0 → 100644
1 | +/** | ||
2 | + * 个人中心二维码 controller | ||
3 | + * @author: weiqingting<qingting.wei@yoho.cn> | ||
4 | + * @date: 2016/05/16 | ||
5 | + */ | ||
6 | + | ||
7 | +'use strict'; | ||
8 | + | ||
9 | +const QRcodeModel = require('../models/qrcode'); | ||
10 | + | ||
11 | +exports.QRcode = (req, res, next) => { | ||
12 | + let id = req.params.id || 0; | ||
13 | + | ||
14 | + QRcodeModel.getQRcodeData(id, req.user.uid).then((result)=>{ | ||
15 | + if (result) { | ||
16 | + result.ticks = result.ticks.map(item=>{ | ||
17 | + if (+item.ticket_type === 2) { | ||
18 | + item.isgroup = true; | ||
19 | + } | ||
20 | + return item; | ||
21 | + }); | ||
22 | + } | ||
23 | + | ||
24 | + let vm = { | ||
25 | + qrcodeData: result | ||
26 | + }; | ||
27 | + | ||
28 | + res.render('QRcode', vm); | ||
29 | + }).catch(next); | ||
30 | +}; |
-
Please register or login to post a comment