|
|
@@ -772,25 +772,6 @@ proto.deductUsdtAsync = P.coroutine(function* (query, method, res){var response
|
|
|
});
|
|
|
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(usdt_amount)).toFixed(2)//下注
|
|
|
-
|
|
|
- yield SGJUserTongji.saveAsync()
|
|
|
- }
|
|
|
-
|
|
|
yield diamondrecord.saveAsync()
|
|
|
yield record.saveAsync()
|
|
|
yield player.saveAsync()
|
|
|
@@ -848,6 +829,13 @@ proto.addUsdtAsync = P.coroutine(function* (query, method, res){var response = {
|
|
|
response.message = "flow invalid"
|
|
|
return this.writeOut(response, res);
|
|
|
}
|
|
|
+ var winloseStr = query["winlose"]
|
|
|
+ if (!winlose) {
|
|
|
+ response.code = 401
|
|
|
+ response.message = "winlose invalid"
|
|
|
+ return this.writeOut(response, res);
|
|
|
+ }
|
|
|
+ var winlose = Number(winloseStr)
|
|
|
usdt_amount = Number(usdt_amount)
|
|
|
if (!checkFishUSDTSign(query)) {
|
|
|
response.code = 403
|
|
|
@@ -899,7 +887,7 @@ proto.addUsdtAsync = P.coroutine(function* (query, method, res){var response = {
|
|
|
SGJUserTongji = app.models.SGJUserTongji({
|
|
|
_id: uuid.v1(),
|
|
|
//userId: player.userId,
|
|
|
- nnwinlose: usdt_amount,
|
|
|
+ nnwinlose: winlose,
|
|
|
nnflow: flow,
|
|
|
todaytime: self.getTodaySJC()
|
|
|
});
|
|
|
@@ -908,7 +896,7 @@ proto.addUsdtAsync = P.coroutine(function* (query, method, res){var response = {
|
|
|
SGJUserTongji = SGJUserTongjis[0]
|
|
|
console.warn("SGJUserTongji:",SGJUserTongji)
|
|
|
//SGJUserTongji.usdt = afterusdt
|
|
|
- SGJUserTongji.nnwinlose = (Number(SGJUserTongji.nnwinlose) -Number(usdt_amount)).toFixed(2)//下注
|
|
|
+ SGJUserTongji.nnwinlose = (Number(SGJUserTongji.nnwinlose) + Number(winlose)).toFixed(2)//下注
|
|
|
SGJUserTongji.nnflow = (Number(SGJUserTongji.nnflow) +Number(nnflow)).toFixed(2)//下注
|
|
|
|
|
|
yield SGJUserTongji.saveAsync()
|