|
|
'use strict';
|
|
|
const moment = require('moment');
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
class grouthNewModel extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
...
|
...
|
@@ -22,21 +21,20 @@ class grouthNewModel extends global.yoho.BaseModel { |
|
|
return this.get(option).then((result => {
|
|
|
if (result && result.code && result.code === 200 && result.data) {
|
|
|
let calculateData = result.data;
|
|
|
let privilegeList = [];
|
|
|
|
|
|
calculateData.expireTime = (calculateData.expireTime && parseInt(calculateData.expireTime, 10) !== 0) ?
|
|
|
moment.unix(calculateData.expireTime).format('YYYY/MM/DD') : '';
|
|
|
|
|
|
if (_.get(calculateData, 'levelInfo.privilege', '')) {
|
|
|
_.forEach(calculateData.levelInfo.privilege, val => {
|
|
|
// if (_.get(calculateData, 'levelInfo.privilege', '')) {
|
|
|
// _.forEach(calculateData.levelInfo.privilege, val => {
|
|
|
|
|
|
if (val.light === 'Y') {
|
|
|
privilegeList.push(val);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
// if (val.light === 'Y') {
|
|
|
// privilegeList.push(val);
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
|
|
|
calculateData.privilegeList = privilegeList;
|
|
|
// calculateData.privilegeList = privilegeList;
|
|
|
|
|
|
return calculateData;
|
|
|
}
|
...
|
...
|
|