statistique register
This commit is contained in:
@@ -27,7 +27,28 @@ Notifications.get = (alias, tribeId) => {
|
||||
data: { notif: [{ tribeId, msg }] },
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Get statistic of registering email phone
|
||||
*/
|
||||
Notifications.statmaillist=(tribe)=>{
|
||||
const statinfo={}
|
||||
const src=`../../${tribe}/objects/maillinglists/*.json`
|
||||
console.log(path.resolve(src))
|
||||
glob.sync(src).forEach(f=>{
|
||||
const name=path.basename(f,".json");
|
||||
const mlst=fs.readJSONSync(f)
|
||||
Object.keys(mlst).forEach(c=>{
|
||||
mlst[c].srckeys.forEach(s=>{
|
||||
if (!statinfo[s]) statinfo[s]={}
|
||||
if (!statinfo[s][name]) statinfo[s][name]=0
|
||||
statinfo[s][name]++
|
||||
})
|
||||
//console.log(c) recupere les contact tel ou email
|
||||
})
|
||||
})
|
||||
|
||||
return {status:200,ref:"Notifications",msg:"statistics",data:statinfo}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an typekey(email) or (phone) key into mailinglist for a tribe
|
||||
|
Reference in New Issue
Block a user