Commit 1713478e authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent a13768f1
...@@ -133,7 +133,7 @@ async function run() { ...@@ -133,7 +133,7 @@ async function run() {
adder[i].platfrom = _.uniq(adder[i].platfrom) adder[i].platfrom = _.uniq(adder[i].platfrom)
adder[i].countOfPlatform=adder[i].platfrom.length adder[i].countOfPlatform=adder[i].platfrom.length
delete adder[i].platfrom // delete adder[i].platfrom
adder[i].pfTrade = _.orderBy(adder[i].pfTrade) adder[i].pfTrade = _.orderBy(adder[i].pfTrade)
let temp=[] let temp=[]
...@@ -144,6 +144,11 @@ async function run() { ...@@ -144,6 +144,11 @@ async function run() {
// adder[i].runUp = _.orderBy(adder[i].runUp) // adder[i].runUp = _.orderBy(adder[i].runUp)
} }
for (let i = 0; i < adder.length; i++) { for (let i = 0; i < adder.length; i++) {
let dates = adder[i].dates let dates = adder[i].dates
let maxDiff = 0 let maxDiff = 0
...@@ -171,10 +176,17 @@ async function run() { ...@@ -171,10 +176,17 @@ async function run() {
adder[i].diffDay = maxDiff adder[i].diffDay = maxDiff
} }
createPlatfileADV(JSON.stringify(adder, null, 2))
for (let i = 0; i < adder.length; i++) {
delete adder[i].platfrom
}
console.log(adder) console.log(adder)
createConfileADV(JSON.stringify(adder, null, 2)) createConfileADV(JSON.stringify(adder, null, 2))
...@@ -286,3 +298,13 @@ function createConfileADV(data) { ...@@ -286,3 +298,13 @@ function createConfileADV(data) {
}); });
}); });
} }
function createPlatfileADV(data) {
// console.log(data)
return new Promise(function (resolve, reject) {
fs.writeFile('plat.json', data, 'utf8', function (err) {
if (err) reject(err);
else resolve(data);
});
});
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment