|
|
@ -70,7 +70,12 @@ module.exports = function (User) {
|
|
|
|
|
|
|
|
|
|
|
|
let line = '';
|
|
|
|
let line = '';
|
|
|
|
usersData.forEach((user, index) => {
|
|
|
|
usersData.forEach((user, index) => {
|
|
|
|
line += `${fields.map(field => user[field]).join(',')}`;
|
|
|
|
line += `${fields.map(field => {
|
|
|
|
|
|
|
|
if ( /^\d+$/.test(user[field])) {
|
|
|
|
|
|
|
|
return `'${user[field]}'`;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return user[field]
|
|
|
|
|
|
|
|
}).join(',')}`;
|
|
|
|
if (showIps) {
|
|
|
|
if (showIps) {
|
|
|
|
userIPs = ips[index] ? ips[index].join(',') : '';
|
|
|
|
userIPs = ips[index] ? ips[index].join(',') : '';
|
|
|
|
line += `,"${userIPs}"\n`;
|
|
|
|
line += `,"${userIPs}"\n`;
|
|
|
|