Browse Source

merge opt-code

DevYK 2 years ago
parent
commit
851669f591
2 changed files with 7 additions and 4 deletions
  1. 0 1
      model/moralis_sdk.js
  2. 7 3
      model/server_data_statistics.js

+ 0 - 1
model/moralis_sdk.js

@@ -474,7 +474,6 @@ async function computeTransferGasFree(obj, my_account_all_coins, tokenPrices) {
 
 function findTokenPriceItem(token_address, tokenPrices) {
     return tokenPrices.tokenPrice.find(element => {
-        // logger.log('findTokenPriceItem find=', element.contract, token_address)
         return element.contract.toLowerCase() == token_address.toLowerCase();
     })
 }

+ 7 - 3
model/server_data_statistics.js

@@ -12,12 +12,13 @@ const { max } = require('moment');
 const feishu_write_table_token_url = 'https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal'
 const feishu_write_table_data_url = 'https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/shtcnp6zbrsep1Sz3Cvk7NXRpDg/values_batch_update'
 const feishu_insert_table_url = 'https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/shtcnp6zbrsep1Sz3Cvk7NXRpDg/insert_dimension_range'
-const reportTime = '08:00:00'
+const reportTime = '02:00:00'
 
 //########################################### 出入金数据统计 ########################################
 
 const http_request_get = async (data) => {
     var host = account_config.STATISTICS_URL
+    // host = 'https://api.denetme.net/denet/wallet/stat/getMoneyStat?date='
     var path = data
     var url = host + path
     logger.log('http_request_get', url)
@@ -530,14 +531,16 @@ function timeoutFunc(config, func) {
 
     config.runNow && func()
 
-    let nowTime = new Date().getTime()
+    let nowTime = new Date(utils.getCurrentDate()).getTime()
+    // nowTime = new Date().getTime()
 
     let timePoints = config.time.split(':').map(i => parseInt(i))
 
-    let recent = new Date().setHours(...timePoints)
+    let recent = new Date(utils.getCurrentDate()).setHours(...timePoints)
 
     recent >= nowTime || (recent += 24 * 3600000)
 
+    console.log('timeoutFunc-------------------', nowTime, timePoints, recent)
     setTimeout(() => {
 
         func()
@@ -696,6 +699,7 @@ timeoutFunc({
         report2FeishuTable()
     }
 })
+// logger.info('getAllBalance  ', getAllBalance())
 module.exports = {
     getStatisticsInfo
 }