new-user-service.js
495 Bytes
'use strict';
const _ = require('lodash');
const api = require('../models/new-user-api');
const check = (uid) => {
return api.getUserSuccessfulOrders(uid).then((result) => {
if (result.code !== 200) {
return {};
}
if (!_.get(result, 'data', false)) {
return {
isNew: false
};
} else {
return {
isNew: true
};
}
});
};
module.exports = {
check
};