|
@@ -771,6 +771,26 @@ proto.deductUsdtAsync = P.coroutine(function* (query, method, res){var response
|
|
|
gameType:query["game_type"],
|
|
gameType:query["game_type"],
|
|
|
});
|
|
});
|
|
|
player.diamond -= usdt_amount
|
|
player.diamond -= usdt_amount
|
|
|
|
|
+
|
|
|
|
|
+ var SGJUserTongjis = yield app.models.SGJUserTongji.findMongoAsync({todaytime:self.getTodaySJC()})
|
|
|
|
|
+ var SGJUserTongji = null
|
|
|
|
|
+ if (SGJUserTongjis.length == 0) {
|
|
|
|
|
+ SGJUserTongji = app.models.SGJUserTongji({
|
|
|
|
|
+ _id: uuid.v1(),
|
|
|
|
|
+ //userId: player.userId,
|
|
|
|
|
+ nnwinlose: 0-usdt_amount,
|
|
|
|
|
+ todaytime: self.getTodaySJC()
|
|
|
|
|
+ });
|
|
|
|
|
+ yield SGJUserTongji.saveAsync()
|
|
|
|
|
+ }else {
|
|
|
|
|
+ SGJUserTongji = SGJUserTongjis[0]
|
|
|
|
|
+ console.warn("SGJUserTongji:",SGJUserTongji)
|
|
|
|
|
+ //SGJUserTongji.usdt = afterusdt
|
|
|
|
|
+ SGJUserTongji.nnwinlose = (Number(SGJUserTongji.nnwinlose) -Number(sgjconfig.usdt_amount)).toFixed(2)//下注
|
|
|
|
|
+
|
|
|
|
|
+ yield SGJUserTongji.saveAsync()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
yield diamondrecord.saveAsync()
|
|
yield diamondrecord.saveAsync()
|
|
|
yield record.saveAsync()
|
|
yield record.saveAsync()
|
|
|
yield player.saveAsync()
|
|
yield player.saveAsync()
|
|
@@ -822,6 +842,12 @@ proto.addUsdtAsync = P.coroutine(function* (query, method, res){var response = {
|
|
|
response.message = "token invalid"
|
|
response.message = "token invalid"
|
|
|
return this.writeOut(response, res);
|
|
return this.writeOut(response, res);
|
|
|
}
|
|
}
|
|
|
|
|
+ var flow = query["flow"]
|
|
|
|
|
+ if (!flow) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "flow invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
usdt_amount = Number(usdt_amount)
|
|
usdt_amount = Number(usdt_amount)
|
|
|
if (!checkFishUSDTSign(query)) {
|
|
if (!checkFishUSDTSign(query)) {
|
|
|
response.code = 403
|
|
response.code = 403
|
|
@@ -866,6 +892,28 @@ proto.addUsdtAsync = P.coroutine(function* (query, method, res){var response = {
|
|
|
gameType:query["game_type"],
|
|
gameType:query["game_type"],
|
|
|
});
|
|
});
|
|
|
player.diamond += usdt_amount
|
|
player.diamond += usdt_amount
|
|
|
|
|
+
|
|
|
|
|
+ var SGJUserTongjis = yield app.models.SGJUserTongji.findMongoAsync({todaytime:self.getTodaySJC()})
|
|
|
|
|
+ var SGJUserTongji = null
|
|
|
|
|
+ if (SGJUserTongjis.length == 0) {
|
|
|
|
|
+ SGJUserTongji = app.models.SGJUserTongji({
|
|
|
|
|
+ _id: uuid.v1(),
|
|
|
|
|
+ //userId: player.userId,
|
|
|
|
|
+ nnwinlose: usdt_amount,
|
|
|
|
|
+ nnflow: flow,
|
|
|
|
|
+ todaytime: self.getTodaySJC()
|
|
|
|
|
+ });
|
|
|
|
|
+ yield SGJUserTongji.saveAsync()
|
|
|
|
|
+ }else {
|
|
|
|
|
+ SGJUserTongji = SGJUserTongjis[0]
|
|
|
|
|
+ console.warn("SGJUserTongji:",SGJUserTongji)
|
|
|
|
|
+ //SGJUserTongji.usdt = afterusdt
|
|
|
|
|
+ SGJUserTongji.nnwinlose = (Number(SGJUserTongji.nnwinlose) +Number(sgjconfig.usdt_amount)).toFixed(2)//下注
|
|
|
|
|
+ SGJUserTongji.nnflow = (Number(SGJUserTongji.nnflow) +Number(sgjconfig.nnflow)).toFixed(2)//下注
|
|
|
|
|
+
|
|
|
|
|
+ yield SGJUserTongji.saveAsync()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
yield diamondrecord.saveAsync()
|
|
yield diamondrecord.saveAsync()
|
|
|
yield record.saveAsync()
|
|
yield record.saveAsync()
|
|
|
yield player.saveAsync()
|
|
yield player.saveAsync()
|