Skip to content

Commit

Permalink
减少不必要的参数
Browse files Browse the repository at this point in the history
  • Loading branch information
dumingcode committed Mar 7, 2019
1 parent 39d2e5f commit 71e6c0f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions service/coverService.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,21 @@ module.exports = {
promiseArr.push(redisUtil.redisHGet(config.redisStoreKey.yearLowStockSet, stocks[i]))
}
return Promise.all(promiseArr).then(function(values) {
console.log(values)
return values.filter(value => { return value != null })

return values.filter(value => { return value != null }).map((jsonStr)=>{
let json = JSON.parse(jsonStr)
let retObj = {
'code': json['code'],
'name': json['name'],
'citiV1': json['citiV1'],
'citiV2': json['citiV2'],
'low': json['low'],
'lowGenDate': json['lowGenDate'],
'ma20': json['ma20']
}
console.log(retObj)
return JSON.stringify(retObj)
})
});

}
Expand Down

0 comments on commit 71e6c0f

Please sign in to comment.