Merge branch 'dev-tequan' into release

This commit is contained in:
dy 2023-12-19 19:27:54 +08:00
commit 9844a5323a
2 changed files with 21 additions and 10 deletions

View File

@ -1,14 +1,25 @@
import { ApiCall } from "tsrpc";
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huobanzhaomu/PtlOpen";
import {ApiCall} from "tsrpc";
import {ReqOpen, ResOpen} from "../../../shared/protocols/event/huobanzhaomu/PtlOpen";
import {PayFun} from "../../../public/pay";
import {payLog} from "../../../shared/protocols/pay/PtlGetList";
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
let db = await G.mongodb.cEvent('huobanzhaomu').findOne({ uid: call.uid, type: 'huobanzhaomu' });
let db = await G.mongodb.cEvent('huobanzhaomu').findOne({uid: call.uid, type: 'huobanzhaomu'});
call.succ({
finish: Object.fromEntries(G.gc.huobanzhaomu.map((conf, i) => {
return [i, conf.gudKey ? call.conn.gud[conf.gudKey] >= conf.total : db?.rec?.length >= G.gc.huobanzhaomu.length - 1];
})),
rec: db?.rec || []
});
let logs: payLog[];
let finish: { [k: number]: boolean } = {};
for (let i = 0; i < G.gc.huobanzhaomu.length; i++) {
let conf = G.gc.huobanzhaomu[i];
if (conf.gudKey == "zhizunyueka") {
if (!logs) {
logs = await PayFun.getPayLog(call.uid, "zhizunyueka");
}
finish[i] = !(logs.length <= 0 || logs.slice(-1)[0].eTime < G.time);
} else {
finish[i] = call.conn.gud[conf.gudKey] >= conf.total;
}
}
call.succ({finish: finish, rec: db?.rec || []});
}

View File

@ -15,6 +15,6 @@ export class TeQuanFun {
return await this.getIsAcTive(call, 'qingbaotequan') ? 1 : 0;
}
static async getTxFreeNum(call: ApiCall) {
return await this.getIsAcTive(call, 'zuozhantequan') ? 2 : 0;
return await this.getIsAcTive(call, 'zuozhantequan') ? 5 : 0;
}
}