fix:
修改伙伴招募的奖励领取条件
This commit is contained in:
parent
db2286509c
commit
070edf1cb5
@ -2,6 +2,7 @@ import { ApiCall } from "tsrpc";
|
|||||||
import {PlayerFun} from '../../../public/player';
|
import {PlayerFun} from '../../../public/player';
|
||||||
import {ReqRec, ResRec} from "../../../shared/protocols/event/huobanzhaomu/PtlRec";
|
import {ReqRec, ResRec} from "../../../shared/protocols/event/huobanzhaomu/PtlRec";
|
||||||
import {HongDianChange} from "../../hongdian/fun";
|
import {HongDianChange} from "../../hongdian/fun";
|
||||||
|
import {PayFun} from "../../../public/pay";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqRec, ResRec>) {
|
export default async function (call: ApiCall<ReqRec, ResRec>) {
|
||||||
let conf = G.gc.huobanzhaomu[call.req.index];
|
let conf = G.gc.huobanzhaomu[call.req.index];
|
||||||
@ -10,7 +11,17 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
|
|||||||
|
|
||||||
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'});
|
||||||
if (db?.rec.includes(call.req.index)) return call.error('', {code: -3});
|
if (db?.rec.includes(call.req.index)) return call.error('', {code: -3});
|
||||||
if (!conf.gudKey && (db?.rec?.length || 0) < G.gc.huobanzhaomu.length - 1) return call.error('', { code: -4 });
|
|
||||||
|
if (conf.gudKey == "chaozhiyueka") {
|
||||||
|
let logs = await PayFun.getPayLog(call.uid, "chaozhiyueka");
|
||||||
|
if (!logs || logs.slice(-1)[0].eTime < G.time) {
|
||||||
|
return call.error('', {code: -4});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!conf.gudKey && (db?.rec?.length || 0) < G.gc.huobanzhaomu.length - 1) {
|
||||||
|
return call.error('', {code: -4});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await PlayerFun.sendPrize(call, conf.prize);
|
await PlayerFun.sendPrize(call, conf.prize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user