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

git pu

parent a13768f1
......@@ -118,7 +118,7 @@ async function run() {
}
}
for (let i = 0; i < adder.length; i++) {
......@@ -133,7 +133,7 @@ async function run() {
adder[i].platfrom = _.uniq(adder[i].platfrom)
adder[i].countOfPlatform=adder[i].platfrom.length
delete adder[i].platfrom
// delete adder[i].platfrom
adder[i].pfTrade = _.orderBy(adder[i].pfTrade)
let temp=[]
......@@ -144,6 +144,11 @@ async function run() {
// adder[i].runUp = _.orderBy(adder[i].runUp)
}
for (let i = 0; i < adder.length; i++) {
let dates = adder[i].dates
let maxDiff = 0
......@@ -171,10 +176,17 @@ async function run() {
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)
createConfileADV(JSON.stringify(adder, null, 2))
......@@ -285,4 +297,14 @@ function createConfileADV(data) {
else resolve(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