|
@@ -1,7 +1,7 @@
|
|
|
const API = require("../../lib/API");
|
|
const API = require("../../lib/API");
|
|
|
const db = require('../../plugin/DataBase/db')
|
|
const db = require('../../plugin/DataBase/db')
|
|
|
const Redis = require('../../plugin/DataBase/Redis')
|
|
const Redis = require('../../plugin/DataBase/Redis')
|
|
|
-const lepao = require("../../lib/Lepao/Lepao.js").lepao
|
|
|
|
|
|
|
+const lepao = require("../../lib/Lepao/cg_lepao.js").Lepao
|
|
|
const { BaseStdResponse } = require("../../BaseStdResponse")
|
|
const { BaseStdResponse } = require("../../BaseStdResponse")
|
|
|
|
|
|
|
|
// 出现异常情况时补充乐跑
|
|
// 出现异常情况时补充乐跑
|
|
@@ -29,7 +29,7 @@ class StartLepao extends API {
|
|
|
|
|
|
|
|
this.logger.info('开始执行补充乐跑任务')
|
|
this.logger.info('开始执行补充乐跑任务')
|
|
|
let sql = `
|
|
let sql = `
|
|
|
- SELECT name, create_user, student_num, token, uid, school_id, state
|
|
|
|
|
|
|
+ SELECT name, create_user, student_num
|
|
|
FROM lepao_account
|
|
FROM lepao_account
|
|
|
WHERE auto_run = 1
|
|
WHERE auto_run = 1
|
|
|
AND (auto_time = ? OR (auto_time = -1 AND today_auto_time = ?))
|
|
AND (auto_time = ? OR (auto_time = -1 AND today_auto_time = ?))
|
|
@@ -39,17 +39,17 @@ class StartLepao extends API {
|
|
|
return this.logger.error('获取补充乐跑账号失败!')
|
|
return this.logger.error('获取补充乐跑账号失败!')
|
|
|
|
|
|
|
|
for (const item of r) {
|
|
for (const item of r) {
|
|
|
- const { name, create_user, student_num, token, uid, school_id, state } = item
|
|
|
|
|
|
|
+ const { name, create_user, student_num } = item
|
|
|
this.logger.info(`${name}(${student_num})开始补充乐跑`)
|
|
this.logger.info(`${name}(${student_num})开始补充乐跑`)
|
|
|
|
|
|
|
|
- const isSuccess = await Redis.get(`lepaoSuccess:${student_num}`)
|
|
|
|
|
|
|
+ const isSuccess = await Redis.get(`cgLepaoSuccess:${student_num}`)
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
|
this.logger.info(`${name}(${student_num})当天已乐跑成功,不执行补充乐跑`)
|
|
this.logger.info(`${name}(${student_num})当天已乐跑成功,不执行补充乐跑`)
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await lepao.beginLepao(create_user, student_num, token, uid, school_id, state)
|
|
|
|
|
|
|
+ await lepao.beginLepao(create_user, student_num)
|
|
|
this.logger.info(`${name}(${student_num})补充乐跑完成`)
|
|
this.logger.info(`${name}(${student_num})补充乐跑完成`)
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
this.logger.error(`${name}(${student_num})补充乐跑失败:${err.message || err}`)
|
|
this.logger.error(`${name}(${student_num})补充乐跑失败:${err.message || err}`)
|