...
|
...
|
@@ -12,10 +12,12 @@ |
|
|
// const camelCase = global.yoho.camelCase;
|
|
|
const api = global.yoho.API;
|
|
|
const queryString = require('querystring');
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
const studentsApi = require('./students-api');
|
|
|
const stuHandler = require('./students-handler');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const crypto = global.yoho.crypto;
|
|
|
|
|
|
// const productProcess = require(`${utils}/product-process`);
|
|
|
// const _ = require('lodash');
|
...
|
...
|
@@ -157,8 +159,25 @@ exports.verifyStudents = (params) => { |
|
|
* @return
|
|
|
*/
|
|
|
exports.userAcquireStatus = (uid, couponIds) => {
|
|
|
return studentsApi.userAcquireStatus(uid, couponIds).
|
|
|
let ids = '';
|
|
|
|
|
|
for (let i = 0; i < couponIds.length; i++) {
|
|
|
if (i === couponIds.length - 1) {
|
|
|
ids += crypto.decrypt('yoho9646abcdefgh', couponIds[i]);
|
|
|
}else {
|
|
|
ids += crypto.decrypt('yoho9646abcdefgh', couponIds[i]) + ',';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return studentsApi.userAcquireStatus(uid, ids).
|
|
|
then(result => {
|
|
|
if (result.code === 200) {
|
|
|
_.forEach(result.data, (value) => {
|
|
|
let couponId = value.couponId.toString(),
|
|
|
cryptoId = crypto.encryption('yoho9646abcdefgh', couponId);
|
|
|
value.couponId = cryptoId;
|
|
|
})
|
|
|
}
|
|
|
return result;
|
|
|
});
|
|
|
}; |
...
|
...
|
|