lsc 1 week ago
parent
commit
2c18d46f2f
1 changed files with 5 additions and 5 deletions
  1. 5 5
      szdjg.js

+ 5 - 5
szdjg.js

@@ -8,14 +8,14 @@ var mysql = require("./mysql");
 
 
 // const _mysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
 // const _mysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
 // const _mysqluser = ["183.36.25.93", "cocorobouser"]; //用户数据库信息
 // const _mysqluser = ["183.36.25.93", "cocorobouser"]; //用户数据库信息
-// const _getmysqlLabor2 = ["183.36.25.93", "pbl"]; //edu數據庫信息
+const _getmysqlLabor2 = ["183.36.25.93", "pbl"]; //edu數據庫信息
 // const _getmysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
 // const _getmysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
 
 
 //线上
 //线上
 
 
 const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
 const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
 const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
 const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
-const _getmysqlLabor2 = ["172.16.12.7", "pbl"]; //edu數據庫信息
+// const _getmysqlLabor2 = ["172.16.12.7", "pbl"]; //edu數據庫信息
 const _getmysqlLabor = ["172.16.12.7", "pbl"]; //edu數據庫信息
 const _getmysqlLabor = ["172.16.12.7", "pbl"]; //edu數據庫信息
 const api = 'http://36.212.150.246:8090'
 const api = 'http://36.212.150.246:8090'
 
 
@@ -124,14 +124,14 @@ router.post("/sync/class", async (req, res) => {
   }
   }
 });
 });
 
 
-router.post("/data", async (req, res) => {
+router.all("/data", async (req, res) => {
   let p = []
   let p = []
-  p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getSzdjgData");
+  p.unshift(_getmysqlLabor2[0], _getmysqlLabor2[1], "getSzdjgData");
   mysql.usselect(p, async function (ret) {
   mysql.usselect(p, async function (ret) {
     let allDownloadCount = 0;
     let allDownloadCount = 0;
     if (ret[7].length) {
     if (ret[7].length) {
       for (let i = 0; i < ret[7].length; i++) {
       for (let i = 0; i < ret[7].length; i++) {
-        allDownloadCount += ret[7][i].count;
+        allDownloadCount += parseInt(ret[7][i].count);
       }
       }
     }
     }
     let dataAddParam = {
     let dataAddParam = {