wubing 1 kuukausi sitten
vanhempi
commit
f646086c46

+ 5 - 2
app/controllers/player.js

@@ -148,7 +148,7 @@ proto.convertUrlToPng = function(url, outputPath, callback) {
 // 创建玩家
 proto.createAsync = P.coroutine(function* (playerId, name, sex, headurl,tel,pwd,ip,spreadId,formId, diamond) {
     console.warn("convertUrlToPng")
-    this.convertUrlToPng('https://bargame.ala456.com/gameRes/1.svg', 'D:/web/root80/'+playerId+'.png', function(err, buffer) {
+    this.convertUrlToPng(headurl, 'D:/web/root80/'+playerId+'.png', function(err, buffer) {
         if (err) {
             console.error('转换失败:' + err.message);
             return;
@@ -156,7 +156,10 @@ proto.createAsync = P.coroutine(function* (playerId, name, sex, headurl,tel,pwd,
         console.log('转换完成,Buffer 长度:' + buffer.length);
     });
     //this.convertUrlToPng(headurl,"D:\\web\\root80\\image\\"+playerId+".png")
-    let diamondReg=500;//5000000;//ts++注册赠送
+    //5000000;//ts++注册赠送
+    let sgjconfigs = yield this.app.models.SGJConfig.findMongoAsync();
+    var sgjconfig = sgjconfigs[0]
+    let diamondReg=sgjconfig.registerUstd;
     if (diamond) {
         // diamondReg = diamond;
     }

+ 1 - 1
app/controllers/shuiguo.js

@@ -416,7 +416,7 @@ proto.joinTableAsync = P.coroutine(function* (playerId, tableId) {
     // }
     // 状态结束
     if (table.state == Table.STATE.END) {
-        console.warn("413 table:",table)
+
         //return { code: C.FAILD, msg: C.TABLE_GAME_OVER };
     }
     // 是否坐满

+ 2 - 0
app/models/game.js

@@ -205,6 +205,7 @@ module.exports = function (app) {
         sgjwinlose: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },               //水果机盈亏
         taskquanget: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },          //获得的奖券
         taskquanlose: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },         //奖券消费
+        houtaiU: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },         //奖券消费
         nowtaskquan:{ type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },           //当前奖券
         todaytime: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },            //统计时间
         taskGetU: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },             //任务获得的U
@@ -394,6 +395,7 @@ module.exports = function (app) {
         istelegram: { type: Number, default: 1 },  //排行榜已发奖励的日期(0点时间戳)
         withdrawfee: { type: Number, default: 3 },  //排行榜已发奖励的日期(0点时间戳)
         withdrawlowlimit: { type: Number, default: 10 },  //排行榜已发奖励的日期(0点时间戳)
+        registerUstd:{ type: Number, default: 0 }
     }, { collection: 'sgjconfig' });
 
     mdbgoose.model('SGJConfig', SGJConfigSchema);

+ 127 - 117
app/servers/hall/handler/hallHandler.js

@@ -98,7 +98,7 @@ proto.checkVersion2 = P.coroutine(function* () {
 //                 // console.warn("大厅给前端主动发消息  user.id  "+user.data.id);
 //                 if (user) playerIds.push(user.id);
 //             }
-            
+
 //         } else {
 //             let user = this.users[cidOrIds];
 //             if (user) playerIds.push(user.id);
@@ -193,7 +193,7 @@ proto.opZSTB = P.coroutine(function* (msg, session, next) {
     var outplayerID = "";/////钻石转出人的ID
     var player = yield this.app.models.Player.findByIdAsync(session.uid, 'diamond synPlayer');
     if (player) {
-         outplayerID = player.synPlayer;
+        outplayerID = player.synPlayer;
     }
     else
     {
@@ -203,7 +203,7 @@ proto.opZSTB = P.coroutine(function* (msg, session, next) {
     {
         return next(null, { code: C.ERROR, msg: C.HTTP_NOTSAME_BINDPLAYER});/////玩家未找到
     }
-    
+
     var outplayer = yield this.app.models.Player.findByIdAsync(outplayerID, 'diamond synPlayer');
     if (outplayer) {
         if(outplayer.synPlayer != session.uid)
@@ -247,13 +247,13 @@ proto.opZSTB = P.coroutine(function* (msg, session, next) {
         yield diamondrecord.saveAsync();
 
         return next(null, { code: C.OK, data: {opdiamond:opDiamondCount,newdiamond:player.diamond} });
-       
+
     }
     else
     {
         return next(null, { code: C.ERROR, msg: C.HTTP_NOTSAME_BINDPLAYER});/////玩家未找到
     }
-           
+
 
 });
 
@@ -373,9 +373,9 @@ proto.getBindPhoneInfo = P.coroutine(function* (msg, session, next) {
     let targetWords = "";
     for (var i = 0; i < list5.length; i++) {
         let ri = list5[i];
-        targetWords += this.wordList[ri]; 
-    }    
-    let data = { 
+        targetWords += this.wordList[ri];
+    }
+    let data = {
         tel:tel,
         pwd:pwd,
         allWords:allWords,
@@ -413,9 +413,9 @@ proto.sendSMSCode = P.coroutine(function* (msg, session, next) {
                     return true;
                 } else {
                     //不是就返回false
-                  return false;
+                    return false;
                 }
-            } 
+            }
             catch (e) {
                 return false;
             }
@@ -484,7 +484,7 @@ proto.sendSMSCode = P.coroutine(function* (msg, session, next) {
                     return next(null, { code: C.ERROR, msg: 115 });//"验证码发送失败"
                 }
                 // console.warn("这里都到返回值了222  ")
-                
+
             });
             // console.warn("请求到这里了???666 body2 "+body2)
         });
@@ -508,7 +508,7 @@ proto.setBindPhone = P.coroutine(function* (msg, session, next) {
     if (!msg.yzm || msg.yzm.length != 6) {
         return next(null, { code: C.ERROR, msg: 112 });//"验证码参数错误"
     }
-    let yzm = msg.yzm 
+    let yzm = msg.yzm
     var yPlayers = yield this.app.models.Player.findMongoAsync({ tel: phoneStr },'_id userId tel pwd');
     // console.warn("?????  设置绑定手机号 ",yPlayers.length,yPlayers[0]._id,session.uid);
     if (yPlayers.length > 1 || (yPlayers.length == 1 && yPlayers[0]._id != session.uid)){
@@ -521,10 +521,10 @@ proto.setBindPhone = P.coroutine(function* (msg, session, next) {
         // player.pwd = "";
         yield player.saveAsync();
     }
-    
+
     yield this.hallLogic.setBindPhone(msg, session, next,player.userId)
-    let data = { 
-       phoneStr:phoneStr 
+    let data = {
+        phoneStr:phoneStr
     }
     return next(null, { code: C.OK, data: data});
 });
@@ -548,9 +548,9 @@ proto.getBindPhoneInfo2 = P.coroutine(function* (msg, session, next) {
     let targetWords = "";
     for (var i = 0; i < list5.length; i++) {
         let ri = list5[i];
-        targetWords += this.wordList[ri]; 
-    }    
-    let data = { 
+        targetWords += this.wordList[ri];
+    }
+    let data = {
         allWords:allWords,
         targetWords:targetWords
     }
@@ -584,9 +584,9 @@ proto.sendSMSCode2 = P.coroutine(function* (msg, session, next) {
                     return true;
                 } else {
                     //不是就返回false
-                  return false;
+                    return false;
                 }
-            } 
+            }
             catch (e) {
                 return false;
             }
@@ -668,7 +668,7 @@ proto.sendSMSCode2 = P.coroutine(function* (msg, session, next) {
                 return next(null, { code: C.ERROR, msg: 115 });//"验证码发送失败"
             }
             // console.warn("这里都到返回值了222  ")
-            
+
         });
         // console.warn("请求到这里了???666 body2 "+body2)
     });
@@ -688,7 +688,7 @@ proto.setBindPhone2 = P.coroutine(function* (msg, session, next) {
     if (!msg.yzm || msg.yzm.length != 6) {
         return next(null, { code: C.ERROR, msg: 112 });//"验证码参数错误"
     }
-    let yzm = msg.yzm 
+    let yzm = msg.yzm
     var tels = yield this.app.models.Tel.findMongoAsync({ tel: phoneStr },'_id tel pwd bindTime');
     if (tels.length != 1){
         return next(null, { code: C.ERROR, msg: 117 });//"手机号已被绑定过"
@@ -705,9 +705,9 @@ proto.setBindPhone2 = P.coroutine(function* (msg, session, next) {
     }
     //给用户发邮件送绑定手机的奖品
     // yield this.hallLogic.setBindPhone(msg, session, next,player.userId)
-    let data = { 
-       phoneStr:phoneStr,
-       yzm:yzm
+    let data = {
+        phoneStr:phoneStr,
+        yzm:yzm
     }
     return next(null, { code: C.OK, data: data});
 });
@@ -717,7 +717,7 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
     if (!session.uid) {
         return next(null, { code: C.ERROR, msg: C.PLAYER_NOT_LOGIN });
     }
-   
+
     // console.warn("require.cache   "+require.cache.length+"   " +require.cache.toString().replace("\r\n",""))
     // console.warn("require.cache000   "+typeof require.cache + "   "+ typeof require.cache[require.resolve('../../../config/hallConfig')]);
     // delete require.cache[require.resolve('../../../config/hallConfig')];
@@ -781,7 +781,7 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
                 }
                 if(yxhdxx.type == 2) {
                     // lcIsOpen = true;
-                    var opts = { 
+                    var opts = {
                         paystate: 1,//支付状态 0未支付 1成功
                         playerId: session.uid,
                         time: { $gte: yxhdxx.startTime, $lt: yxhdxx.endTime }
@@ -793,7 +793,7 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
                         hdqjcz += list[j].total_fee/100;
                     }
                     //下面是从钻石变更记录数据表中读取任务的是否已领取的情况
-                    var cxlqopts = { 
+                    var cxlqopts = {
                         playerId: session.uid,
                         dType: 13,//活动类型
                         registerTime: { $gte: yxhdxx.startTime, $lt: yxhdxx.endTime }
@@ -807,18 +807,18 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
                     for (var j = 0; j < activeInfoList[i].reachAndRewardInfo.length; j++) {
                         activeInfoList[i].reachAndRewardInfo[j].isylq = lcszylqxbs.indexOf(j) != -1;
                     }
-                    
+
                 }
                 if(yxhdxx.type == 3) {
                     // ljdjIsOpen = true;
-                    var opts = { 
+                    var opts = {
                         "users._id": session.uid,
                         stime: { $gte: yxhdxx.startTime, $lt: yxhdxx.endTime }
                     };
                     // logger.warn("hall countMongoAsync users._id111--------" + session.uid );
                     hdqjdj = yield this.app.models.FHMJTables.countMongoAsync(opts);
                     //下面是从钻石变更记录数据表中读取任务的是否已领取的情况
-                    var cxlqopts = { 
+                    var cxlqopts = {
                         playerId: session.uid,
                         dType: 14,//活动类型
                         registerTime: { $gte: yxhdxx.startTime, $lt: yxhdxx.endTime }
@@ -836,7 +836,7 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
             }
         }
     }
-    
+
     // if(lcIsOpen){
     //     var opts = { 
     //         paystate: 0,//支付状态 0未支付 1成功
@@ -845,7 +845,7 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
     //     };
     //     var onlineCount = yield app.models.Player.countMongoAsync(opts);
     // }
-    let data = { 
+    let data = {
         hdqjcz: hdqjcz,
         hdqjdj: hdqjdj,
         nowTime: xzdsjc,
@@ -863,7 +863,7 @@ proto.activityInfo = P.coroutine(function* (msg, session, next) {
         r2:r2,
         r3:r3,
         r4:r4,
-        r5:r5 
+        r5:r5
     }
     return next(null, { code: C.OK, data: data});
 });
@@ -894,13 +894,13 @@ proto.activityIn = P.coroutine(function* (msg, session, next) {
             yield player.saveAsync();
             // 钻石记录
             var diamondrecord = new this.app.models.DiamondRecord({
-            _id: uuid.v1(),
-            playerId: session.uid,
-            dType: 6,//活动奖励
-            dSource: diamondSource,
-            dSwap: spreadRebate,
-            dNow: diamondNew
-             });
+                _id: uuid.v1(),
+                playerId: session.uid,
+                dType: 6,//活动奖励
+                dSource: diamondSource,
+                dSwap: spreadRebate,
+                dNow: diamondNew
+            });
             yield diamondrecord.saveAsync();
 
             diamond += spreadRebate;
@@ -951,7 +951,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
     if(type == 2) lzType = 13;//13活动期间累充送钻石
     else if(type == 3) lzType = 14;//14活动期间组局领钻
     if(lzType > 0 && index != 10000){//单项领取,一键领取不在这里进行处理
-        var opts = { 
+        var opts = {
             playerId: session.uid,
             dType: lzType,//活动类型
             tableId: index+"",//活动下标
@@ -968,7 +968,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
     }
     else if(type == 2){
         //领取活动期间累充送钻
-        var opts = { 
+        var opts = {
             paystate: 1,//支付状态 0未支付 1成功
             playerId: session.uid,
             time: { $gte: activeData.startTime, $lt: activeData.endTime }
@@ -982,7 +982,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
         }
         if(index == 10000){
             //下面是从钻石变更记录数据表中读取任务的是否已领取的情况
-            var cxlqopts = { 
+            var cxlqopts = {
                 playerId: session.uid,
                 dType: 13,//活动类型
                 registerTime: { $gte: activeData.startTime, $lt: activeData.endTime }
@@ -992,7 +992,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
             for (var z = 0; z < lqqklist.length; z++) {
                 lcszylqxbs[lcszylqxbs.length] = Number(lqqklist[z].tableId)
             }
-            
+
             for (var i = 0; i < activeData.reachAndRewardInfo.length; i++) {
                 let targetCount = activeData.reachAndRewardInfo[i].reachCount;//任务的目标值
                 // console.warn("活动期间累计充值: 一键领取 "+hdqjcz + "  要求充值  "+targetCount);
@@ -1026,7 +1026,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
     else if(type == 3){
         //领取活动期间累计组局领钻
         let hdqjdj = 0;
-        var opts = { 
+        var opts = {
             "users._id": session.uid,
             stime: { $gte: activeData.startTime, $lt: activeData.endTime }
         };
@@ -1035,7 +1035,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
 
         if(index == 10000){
             //下面是从钻石变更记录数据表中读取任务的是否已领取的情况
-            var cxlqopts = { 
+            var cxlqopts = {
                 playerId: session.uid,
                 dType: 14,//活动类型
                 registerTime: { $gte: activeData.startTime, $lt: activeData.endTime }
@@ -1092,7 +1092,7 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
         player.diamond += addDimand;
         yield player.saveAsync();
 
-        
+
         // 钻石记录
         /* dType:类型 1为注册2为充值3坐下4退分5礼物6活动7后台 8同步转出 9同步转入10签到11每日奖励12分享赠送,
             13活动期间累充送钻石,14活动期间组局领钻,15活动期间回归用户每日领钻,
@@ -1141,11 +1141,11 @@ proto.otherActivityIn = P.coroutine(function* (msg, session, next) {
             rewardC: addDimand
         }
     }
-    let returndata = { 
-        type: type, 
-        index: index, 
+    let returndata = {
+        type: type,
+        index: index,
         getGoodsList: getGoodsList,
-        
+
     }
     return next(null, { code: C.OK,data:returndata });
 });
@@ -1176,7 +1176,7 @@ proto.signInfo = P.coroutine(function* (msg, session, next) {
     var hasSign = signinfo.lastTime < today.getTime() ? 0 : 1;
     var hasShare = signinfo.shareTime < today.getTime() ? 0 : 1;
     let signAwards = confHall.signAwards || {};
-    let data = { 
+    let data = {
         keep: signinfo.keep,
         signAwards:signAwards,
         hasSign: hasSign,
@@ -1257,7 +1257,7 @@ proto.shiMingRenZheng = P.coroutine(function* (msg, session, next) {
         player.smCardId = msg.cardId;
         yield player.saveAsync();
     }
-     let data = { 
+    let data = {
         name: msg.name,
         cardId: msg.cardId
     }
@@ -1303,8 +1303,8 @@ proto.activeSignInfo = P.coroutine(function* (msg, session, next) {
                 wcqk[index][0]++;////这天被自己邀请的人完成任务的人数
                 wcqk[index][1]+=list[i].totalfee;////这天被自己邀请的人完成任务的奖励总额
                 rwzjl += list[i].totalfee;
-            } 
-        }     
+            }
+        }
     }
     let jlffqk = 0;////0:未领取,1已领取,2已发放
     var opts2 = {type: { $gte: acType, $lt: acType+1 }};
@@ -1315,9 +1315,9 @@ proto.activeSignInfo = P.coroutine(function* (msg, session, next) {
         else jlffqk = 2;
     }
     let jtshddjt = Math.ceil((Date.now()-startTime)/86400000);////今天是活动的第几天
-    let data = { 
+    let data = {
         rwzjl: rwzjl,
-        wcqk: wcqk, 
+        wcqk: wcqk,
         acType: acType,
         jlffqk: jlffqk,
         jtshddjt: jtshddjt
@@ -1355,16 +1355,16 @@ proto.getActiveYQXQ = P.coroutine(function* (msg, session, next) {
                 }
                 wcqk[wcqk.length] = item;
             }
-        } 
+        }
     }
     let jtshddjt = dayIndex + 1;//Math.ceil((Date.now()-startTime)/86400000);////今天是活动的第几天
-    let data = { 
-        wcqk: wcqk, 
+    let data = {
+        wcqk: wcqk,
         acType: acType,
         jtshddjt: jtshddjt
     }
 
-    
+
     return next(null, { code: C.OK, data: data });
 });
 
@@ -1402,14 +1402,14 @@ proto.activeSignLQJL = P.coroutine(function* (msg, session, next) {
     let ruid = 0;// 此条奖励领取的玩家userId
     for (let i = 0; i < list.length; ++i) {
         if(list[i].succState && list[i].type == acType){////该活动的所有记录
-           rwzjl += list[i].totalfee;
-           retype = list[i].rewardtype;
-           if(ruid == 0){
+            rwzjl += list[i].totalfee;
+            retype = list[i].rewardtype;
+            if(ruid == 0){
                 if(acType == 1) ruid = list[i].suid;////国庆签到
                 else if(acType == 2) ruid = parseInt(list[i].rid);////国庆邀请
-           }
-           
-        }  
+            }
+
+        }
     }
 
     var activereciverec = new this.app.models.ActiveReceiveRecord({
@@ -1425,7 +1425,7 @@ proto.activeSignLQJL = P.coroutine(function* (msg, session, next) {
     yield activereciverec.saveAsync();
     let jtshddjt = Math.ceil((Date.now()-startTime)/86400000);////今天是活动的第几天
     let jlffqk = 1;////0:未领取,1已领取,2已发放
-    let data = { 
+    let data = {
         acType: acType,
         jlffqk: jlffqk,
         jtshddjt: jtshddjt
@@ -1531,7 +1531,7 @@ proto.getPayGiven = P.coroutine(function* (msg, session, next) {
         }
         if(jipaiqi.times1 > 0 || jipaiqi.times2 > 0) sfscjpq = 0;
     }
-    let data = { 
+    let data = {
         currtime: Date.now(),
         jrzcz: jrzcz,
         jrczsx: jrczsx,
@@ -1551,7 +1551,7 @@ proto.tgyInfo = P.coroutine(function* (msg, session, next) {
     if (!session.uid) {
         return next(null, { code: C.ERROR, msg: C.PLAYER_NOT_LOGIN });
     }
-    
+
     var uid = session.uid;
     let tgState = 1;////未申请=1;正在审核=2;审核成功=3,审核失败=4
     let myUrl = "";
@@ -1566,7 +1566,7 @@ proto.tgyInfo = P.coroutine(function* (msg, session, next) {
         if (player) {
             tgState = player.tgState;
         }
-    }   
+    }
     return next(null, { code: C.OK, tgState: tgState,myUrl:myUrl });
 });
 
@@ -1575,7 +1575,7 @@ proto.applyTGY = P.coroutine(function* (msg, session, next) {
     if (!session.uid) {
         return next(null, { code: C.ERROR, msg: C.PLAYER_NOT_LOGIN });
     }
-    
+
     ////所申请的推广员姓名
     if(!msg.tgName || msg.tgName == ""){
         return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
@@ -1593,7 +1593,7 @@ proto.applyTGY = P.coroutine(function* (msg, session, next) {
     // console.warn("申请推广员  tgName  "+msg.tgName+"  tgPhone  "+msg.tgPhone+"  tgWXNumber  "+msg.tgWXNumber);
     var player = yield this.app.models.tgApply.findByIdReadOnlyAsync(uid);
     if (!player) {
-        
+
         var tgapply = new this.app.models.tgApply({
             _id: uid,
             applyType: 1,
@@ -1624,8 +1624,8 @@ proto.share = P.coroutine(function* (msg, session, next) {
     today.setMilliseconds(0);
     var signinfo = yield this.app.models.SignInfo.findByIdAsync(session.uid, 'shareTime');
     if (!signinfo) {
-        signinfo = new this.app.models.SignInfo({ 
-            _id: session.uid 
+        signinfo = new this.app.models.SignInfo({
+            _id: session.uid
         });
     }
     var diamond = 0;
@@ -1686,7 +1686,7 @@ proto.gameInfo = P.coroutine(function* (msg, session, next) {
     //var uid = session.uid +'-'+today;//今天
     //console.warn("ts+++++统计信息",uid);
     //var uid1 = session.uid +'-'+ new Date(new Date().getTime() - 86400000).Format("yyyy-MM-dd");//昨天
-    
+
 
     let ttCount=0;
     let winCount=0;
@@ -1708,10 +1708,10 @@ proto.gameInfo = P.coroutine(function* (msg, session, next) {
     return next(null, { code: C.OK, list: list });
 
     //uid = '85456dda-5119-a2bc-3c2d-f17f74a19fa6@my2016'/////TL++
-    
+
     // var uid = '12e3cf2b-4b54-f782-c041-9d959c0a0d25@my2016'
-    
-    
+
+
 //     var list = [];
 //     for (let gameId = 10001; gameId <= 10009; ++gameId) {
 //         let gamer = null;
@@ -1723,7 +1723,7 @@ proto.gameInfo = P.coroutine(function* (msg, session, next) {
 //         if (gamer) list.push({ gameId: gameId, ttCount: gamer.ttCount, winCount: gamer.winCount });
 //     }
 //     return next(null, { code: C.OK, list: list });
-     });
+});
 
 // 历史战绩
 proto.getHistory = P.coroutine(function* (msg, session, next) {
@@ -1749,7 +1749,7 @@ proto.getHistory = P.coroutine(function* (msg, session, next) {
     let winRate=0;
     let listCount=0;
 
-    
+
     var startTime =today.getTime() - 86400000;
     var endTime =today.getTime() + 86400000;
 
@@ -1772,22 +1772,22 @@ proto.getHistory = P.coroutine(function* (msg, session, next) {
         if(i<10)
         {
             listCount++;
-            let item = { 
+            let item = {
                 _id:record._id,
                 gameId: record.gameId,
                 tableNo: record.tableNo,
                 agentId: record.agentId,
                 type: record.type,
-                kind: record.kind, 
-                other: record.other, 
-                playerCount: record.playerCount, 
+                kind: record.kind,
+                other: record.other,
+                playerCount: record.playerCount,
                 round: record.round,
-                over: record.over, 
+                over: record.over,
                 time: record.time,
                 ctime: record.ctime,
                 stime: record.stime,
                 // sszjFile: record.sszjFile, 
-                sszj: record.sszj, 
+                sszj: record.sszj,
                 users: record.users };
             //console.warn("战绩-------------------",item);
             data.list.push(item);
@@ -1887,8 +1887,8 @@ proto.tableRecord = P.coroutine(function* (msg, session, next) {
     if (!record) {
         // console.warn("这个房间没有战绩",msg.tid);
         return next(null, { code: C.FAILD,tid:msg.tid, msg: C.TABLE_NOT_FOUND });
-    } 
-    let data = { 
+    }
+    let data = {
         _id:record._id,
         gameId: record.gameId,
         tableNo: record.tableNo,
@@ -1900,11 +1900,11 @@ proto.tableRecord = P.coroutine(function* (msg, session, next) {
         ctime: record.ctime,
         sszjFile: record.sszjFile,
         sszj: record.sszj,
-        users: record.users 
-     };
+        users: record.users
+    };
     // console.warn("这个房间de战绩shi",record);
     return next(null, { code: C.OK, data: data });
-    
+
 });
 
 //ts++得到下一局的信息
@@ -1923,8 +1923,8 @@ proto.getTableNext = P.coroutine(function* (msg, session, next) {
     if (!record) {
         // console.warn("得到下一局的信息查找桌子不存在");
         return next(null, { code: C.FAILD, msg: C.TABLE_NOT_FOUND });
-    } 
-    let data = { 
+    }
+    let data = {
         _id:record._id,
         gameId: record.gameId,
         tableNo: record.tableNo,
@@ -1932,7 +1932,7 @@ proto.getTableNext = P.coroutine(function* (msg, session, next) {
         kind: record.kind,
         round: record.round,
         over: record.over,
-        time: record.time 
+        time: record.time
     };
     //console.warn("xxx得到下一局的信息-------------------",data)
     return next(null, { code: C.OK, data: data });
@@ -1956,7 +1956,7 @@ proto.getBiSaiHall = P.coroutine(function* (msg, session, next) {
     let jrStart = this.lconfigCommon.getTodaySJC();
     // nowTime = 1684925400000;
     // jrStart = 1681920000000;
-    var opts = { 
+    var opts = {
         stime: { $gte: jrStart },
         outTime: {$gt: nowTime}//过期时间大于当前时间
     };
@@ -1995,7 +1995,7 @@ proto.getBiSaiInfo = P.coroutine(function* (msg, session, next) {
     let jrStart = this.lconfigCommon.getTodaySJC();
     // nowTime = 1684925400000;
     // jrStart = 1681920000000;
-    var opts = { 
+    var opts = {
         stime: { $gte: jrStart },
         outTime: {$gt: nowTime}//过期时间大于当前时间
     };
@@ -2085,7 +2085,7 @@ proto.getBiSaiInfo = P.coroutine(function* (msg, session, next) {
         this.app.controllers.bisai.clearPlayers(agentId);
         // console.warn("现在不是处于比赛时间   清空匹配列表");
     }
-   
+
     let wantBSUList = this.app.controllers.bisai.getPlayers(agentId)
     // console.warn("hallhander  得到列表  长度111  "+wantBSUList.length + JSON.stringify(wantBSUList));
     let nowCount = wantBSUList.length;//目前正在匹配的玩家个数
@@ -2093,7 +2093,7 @@ proto.getBiSaiInfo = P.coroutine(function* (msg, session, next) {
     let over = 0;////本场比赛该玩家完成的大局数
     if(xzsfcybs && ckszbsccxx){
         timelist = [ckszbsccxx];
-        var opts = { 
+        var opts = {
             stime: { $gte: ckszbsccxx.stime, $lt: ckszbsccxx.etime },
             over: { $gte: 1 }
         };
@@ -2149,7 +2149,7 @@ proto.toBiSai = P.coroutine(function* (msg, session, next) {
     if(bsIndex == -1) return next(null, { code: C.FAILD, msg: "is not compete aid" });//非比赛链接
     let nowTime2 = Date.now();
     // nowTime2 = 1681977609000;
-    var opts = { 
+    var opts = {
         stime: { $lte: nowTime2 },
         etime: { $gt: nowTime2 },
         outTime: {$gt: nowTime2}//过期时间大于当前时间
@@ -2241,7 +2241,7 @@ proto.getBiSaiPaiMing = P.coroutine(function* (msg, session, next) {
     let jrStart = this.lconfigCommon.getTodaySJC();
     // nowTime = 1684925400000;
     // jrStart = 1681920000000;
-    var opts = { 
+    var opts = {
         stime: { $gte: jrStart },
         outTime: {$gt: nowTime}//过期时间大于当前时间
     };
@@ -2271,7 +2271,7 @@ proto.getBiSaiPaiMing = P.coroutine(function* (msg, session, next) {
             return next(null, { code: C.OK, data: da });
         }
         if(jlbspmgbsj < 0) iszzpm = true;
-        var opts = { 
+        var opts = {
             stime: { $gte: ckszbsccxx.stime, $lt: ckszbsccxx.etime },
             over: { $gte: 1 }
         };
@@ -2348,7 +2348,7 @@ proto.getBiSaiJiangPin = P.coroutine(function* (msg, session, next) {
     let jrStart = this.lconfigCommon.getTodaySJC();
     // nowTime = 1684925400000;
     // jrStart = 1681920000000;
-    var opts = { 
+    var opts = {
         stime: { $gte: jrStart },
         outTime: {$gt: nowTime}//过期时间大于当前时间
     };
@@ -2365,7 +2365,7 @@ proto.getBiSaiJiangPin = P.coroutine(function* (msg, session, next) {
     let userList = [];//今日比赛所有参与的玩家uid
     let ckszbsccxx = timelist[0];//此刻所处比赛场的比赛信息
     if(ckszbsccxx){
-        var opts = { 
+        var opts = {
             stime: { $gte: ckszbsccxx.stime, $lt: ckszbsccxx.etime },
             over: { $gte: 1 }
         };
@@ -2410,7 +2410,7 @@ proto.getPaiHangInfo = P.coroutine(function* (msg, session, next) {
     let uid = session.uid;
     let limit = 10;//前10名上榜
     var jrStart = this.lconfigCommon.getTodaySJC();
-    var opts = { 
+    var opts = {
         time1: jrStart,
         quan1: { $gt: 0}
     };
@@ -2505,7 +2505,7 @@ proto.feedback = P.coroutine(function* (msg, session, next) {
     if(msg.bugFileName1) bugFileName1 = String(msg.bugFileName1);
     if(msg.bugFileName2) bugFileName2 = String(msg.bugFileName2);
     if(msg.bugFileName3) bugFileName3 = String(msg.bugFileName3);
-    
+
     // console.warn("111xxxxxxxxx反馈接口 前端提交bug用的",bugContent,bugFileName1,bugFileName2,bugFileName3);
     // console.warn("222xxxxxxxxx反馈接口 前端提交bug用的",msg.bugContent,msg.bugFileName1,msg.bugFileName2,msg.bugFileName3);
     var bugrecords = new this.app.models.BugRecords({
@@ -2690,7 +2690,7 @@ proto.mailInfo = P.coroutine(function* (msg, session, next) {
             yield mails.saveAsync();*/
             ////// 增加测试数据结束
 
-             console.warn("该玩家的邮件个数   "+mails.mailInfos.length);
+            console.warn("该玩家的邮件个数   "+mails.mailInfos.length);
             data.mailInfos = []
             for (let i = 0; i < mails.mailInfos.length; ++i) {
                 if(i < 60 && mails.mailInfos[i]){
@@ -2706,7 +2706,7 @@ proto.mailInfo = P.coroutine(function* (msg, session, next) {
         // console.warn("邮件数据库中没有该玩家");
         // let player = yield this.app.models.Player.findByIdAsync(session.uid, '_id userId');
         // if(player){
-            // console.warn("邮件数据库中没有该玩家  _id   "+player._id+"   userId   "+player.userId);
+        // console.warn("邮件数据库中没有该玩家  _id   "+player._id+"   userId   "+player.userId);
         //     ////// 下面是添加测试数据
         //     console.warn("下面是添加测试数据   "+Date.now());
         //     data.userId = player.userId;
@@ -2844,7 +2844,7 @@ proto.mailInfo = P.coroutine(function* (msg, session, next) {
         // }
         //console.warn("该玩家的邮件个数   "+mails.mailInfos.length);
     }
-    
+
     return next(null, { code: C.OK, data: data });
 });
 
@@ -2914,7 +2914,7 @@ proto.dealMail = P.coroutine(function* (msg, session, next) {
                             }
                         }
                         else{
-                           if(newItem.read == 1){
+                            if(newItem.read == 1){
                                 newItem = null;
                             }
                             else{
@@ -2948,7 +2948,7 @@ proto.dealMail = P.coroutine(function* (msg, session, next) {
                     }
                 }
                 newMailList[i] = newItem;
-                
+
             }
         }
         // console.warn("newMailList的长度   "+newMailList.length);
@@ -2996,14 +2996,24 @@ proto.dealMail = P.coroutine(function* (msg, session, next) {
                             _id: uuid.v1(),
                             //userId: player.userId,
                             //usdt: klqList[i].dNow,
-                            taskGetU: klqList[i].rewardC,//下注
+                            //taskGetU: klqList[i].rewardC,//下注
                             todaytime: this.logic.getTodaySJC()
                         });
+                        if (dType == 7) {
+                            SGJUserTongji.houtaiU = klqList[i].toFixed(2)
+                        }else {
+                            SGJUserTongji.taskGetU = klqList[i].rewardC.toFixed(2)
+                        }
                         yield SGJUserTongji.saveAsync()
                     }else {
                         SGJUserTongji = SGJUserTongjis[0]
                         //SGJUserTongji.usdt = klqList[i].dNow
                         SGJUserTongji.taskGetU = (Number(SGJUserTongji.taskGetU) +Number(klqList[i].rewardC)).toFixed(2)//下注
+                        if (dType == 7) {
+                            SGJUserTongji.houtaiU = (Number(SGJUserTongji.houtaiU) +Number(klqList[i].rewardC)).toFixed(2)//下注
+                        }else {
+                            SGJUserTongji.taskGetU = (Number(SGJUserTongji.taskGetU) +Number(klqList[i].rewardC)).toFixed(2)//下注
+                        }
                         yield SGJUserTongji.saveAsync()
                     }
                 }
@@ -3022,9 +3032,9 @@ proto.dealMail = P.coroutine(function* (msg, session, next) {
         }
     }
     else{
-        
+
     }
-    
+
     return next(null, { code: C.OK, data: data });
 });
 
@@ -3047,8 +3057,8 @@ proto.shiyongJPQ = P.coroutine(function* (msg, session, next) {
     let jipaiqi = yield this.app.models.JiPaiQi.findByIdAsync(playerId, 'times0 jpqdqsj');
     if (jipaiqi) {
         if(jipaiqi.jpqdqsj > 0) currtime = jipaiqi.jpqdqsj;
-    }        
-    
+    }
+
     let czts = 3;//充值天数,免费试用3天
     let jpqdqsj = currtime + czts*86400000;//记牌器到期时间
     if (jipaiqi) {

+ 156 - 155
app/shuiguo/table.js

@@ -122,7 +122,7 @@ var Table = function (cPlayerId,cUserId,cName,cHead,game, id, cell, round, type,
     this.ydxwin = 0;   //所有玩家押大小总赢得
     this.ydxxh = 0;    //所有玩家押大小总消耗(总下注-总赢得)
     this.ydxzcs = 0;   //该日押大小总次数
-    this.allrwq = 0;   //所有奖券产生总量   
+    this.allrwq = 0;   //所有奖券产生总量
     this.rwxhjq1 = 0;  //钻石任务消耗奖券总量(领任务时记录)
     this.rwxhjq2 = 0;  //RMB任务消耗奖券总量(领任务时记录)
     this.rwdcze1 = 0;  //钻石任务兑出总额(领奖时记录)
@@ -241,7 +241,7 @@ proto.isOnline = function () {
 
 // 重置本局
 proto.resetRound = function () {
-  
+
 };
 
 // 发送消息
@@ -313,7 +313,7 @@ proto.getTableInfo = function () {
         yxndlbTime:this.yxndlbTime,
         yxndlbTip:this.yxndlbTip,
     };
-    
+
     // 桌上玩家
     for (let i = 0; i < this.users.length; ++i) {
         let user = this.users[i];
@@ -323,7 +323,7 @@ proto.getTableInfo = function () {
             let score = 0;
             let uinfo = {
                 account: user.account, name: user.name, sex: user.sex, headurl: user.headurl,
-                diamond:user.diamond, state: user.state2, taskQuan: user.taskQuan, 
+                diamond:user.diamond, state: user.state2, taskQuan: user.taskQuan,
                 drCount: user.drCount,chairId: user.chairId
             };
             console.warn("uinfo:",uinfo)
@@ -551,7 +551,7 @@ proto.joinAsync = cor(function* (user) {
                 }
             }
         }
-        
+
     }
     else{
         console.warn("500")
@@ -565,7 +565,7 @@ proto.joinAsync = cor(function* (user) {
         }
     }
     user.diamond = user.diamond.toFixed(2)
-    let str3 = "加入水果 "+ this.nowDiamond2 +"  ud  "+user.diamond + " drCount " + drCount;      
+    let str3 = "加入水果 "+ this.nowDiamond2 +"  ud  "+user.diamond + " drCount " + drCount;
     if(this.users.length == 0) {
         this.users[0] = user;
         // this.score.addUser(user.id,0,user.userId, user.name, user.sex, user.headurl,user.diamond,this.gameKindTL);
@@ -577,7 +577,7 @@ proto.joinAsync = cor(function* (user) {
         // console.warn("加入桌子  user.taskQuan222 ",user.taskQuan,user.diamond);
         this.nowDiamond = user.diamond;//玩家目前游戏内的钻石(带入的)
         this.nowDiamond2 = user.diamond;//玩家目前游戏外的钻石(所有的减去带入的)
-        str3 += "这里赋值 "+ this.nowDiamond2 +"  ud2  "+user.diamond; 
+        str3 += "这里赋值 "+ this.nowDiamond2 +"  ud2  "+user.diamond;
     }
     logger.warn(str3);////cssj
     // 加入桌子之后
@@ -708,7 +708,7 @@ proto.zsbgjlAsync = cor(function* (user, chairId) {
                 ydxwin: this.ydxwin,   //所有玩家押大小总赢得
                 ydxxh: this.ydxxh,    //所有玩家押大小总消耗(总赢得 - 总下注)
                 ydxzcs: this.ydxzcs,   //该日押大小总次数
-                allrwq: this.allrwq,   //所有奖券产生总量   
+                allrwq: this.allrwq,   //所有奖券产生总量
                 rwxhjq1: this.rwxhjq1,  //钻石任务消耗奖券总量(领任务时记录)
                 rwxhjq2: this.rwxhjq2,  //RMB任务消耗奖券总量(领任务时记录)
                 rwdcze1: this.rwdcze1,  //钻石任务兑出总额(领奖时记录)
@@ -752,8 +752,8 @@ proto.zsbgjlAsync = cor(function* (user, chairId) {
                 let allydze = [];
                 let gxzydze = [];
                 let gxcxzcs = [];
-                let tsxzydze = []; 
-                let tsxcxzcs = []; 
+                let tsxzydze = [];
+                let tsxcxzcs = [];
                 // 下面这两个数据是长度为8的数组,分别代表[苹果,橙子,芒果,铃铛,西瓜,星星,七七,王王]
                 for (var i = 0; i < sgjztj.allyzze.length; i++) {
                     allyzze[i] = sgjztj.allyzze[i] + this.allyzze[i];
@@ -806,7 +806,7 @@ proto.zsbgjlAsync = cor(function* (user, chairId) {
                 ydxCost: this.ydxCost,  //所有玩家押大小总下注
                 ydxwin: this.ydxwin,   //所有玩家押大小总赢得
                 ydxxh: this.ydxxh,    //所有玩家押大小总消耗(总赢得 - 总下注)
-                allrwq: this.allrwq,   //所有奖券产生总量   
+                allrwq: this.allrwq,   //所有奖券产生总量
                 rwxhjq1: this.rwxhjq1,  //钻石任务消耗奖券总量(领任务时记录)
                 rwxhjq2: this.rwxhjq2,  //RMB任务消耗奖券总量(领任务时记录)
                 rwxhjq3: 0,  //备用任务1消耗奖券总量(领任务时记录)
@@ -894,7 +894,7 @@ proto.beforeLeaveAsync = cor(function* (user) {
 
 // 离开桌子之后
 proto.afterLeaveAsync = cor(function* (user) {
-   
+
     // 离开通知
     /////TL++zsyl 在此之前离开玩家已经从玩家列表或者旁观者列表中删除了所以把下面这句提到前面去了
     return this.pushMsgAsync(-1, 'shuiguo_event', { type: M.LEAVE, data: { account: user.account } });
@@ -935,21 +935,21 @@ proto.overTableAsync = cor(function* (user) {
 // 得到战绩
 proto.getRecordAsync = P.coroutine(function* (user) {
     // console.warn("得到战绩   "+user.id);
-    var opts = { 
+    var opts = {
         ownerId:user.id//time: { $gte: startTime, $lt: endTime },
-        
+
     };
     var list = yield this.app.models.SGJTables.findMongoAsync(opts, 'ownerId time gameCost yazhuList resultList winsList win bsIndex scoreBefore scoreEnd', { sort: { time: -1 } ,limit:25});
     // console.warn("战绩-------------------length",list.length);
     let records = [];
-    let nowTime = Date.now();//当前时间戳  
+    let nowTime = Date.now();//当前时间戳
     for (let i = 0; i < list.length; ++i) {
         // console.warn("战绩条目    "+i+"    "+JSON.stringify(list[i]));
         if(list[i].time + 8000 > nowTime) continue;
         let item = {
             time:list[i].time,
             gameCost:list[i].gameCost,
-            yazhuList:list[i].yazhuList, 
+            yazhuList:list[i].yazhuList,
             resultList:list[i].resultList,
             win:list[i].scoreEnd - list[i].scoreBefore,
             bsIndex:list[i].bsIndex
@@ -969,7 +969,7 @@ proto.getjzjrldzcz = cor(function* () {
     if (player) totalMoney = player.totalMoney;
     if(totalMoney > 0){
         let jrgwjzcz = 0;//今日该玩家总充值
-        let opts3 = { 
+        let opts3 = {
             playerId: this.ownerId,
             paystate: 1,
             time: { $gte: jrStart, $lt: jrStart+86400000}
@@ -1010,7 +1010,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
     this.ydxwin = 0;   //所有玩家押大小总赢得
     this.ydxxh = 0;    //所有玩家押大小总消耗(总下注-总赢得)
     this.ydxzcs = 0;   //该日押大小总次数
-    this.allrwq = 0;   //所有奖券产生总量   
+    this.allrwq = 0;   //所有奖券产生总量
     this.rwxhjq1 = 0;  //钻石任务消耗奖券总量(领任务时记录)
     this.rwxhjq2 = 0;  //RMB任务消耗奖券总量(领任务时记录)
     this.rwdcze1 = 0;  //钻石任务兑出总额(领奖时记录)
@@ -1018,7 +1018,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
     this.allCost = 0;  //所有玩家总下注
     this.allwin = 0;   //所有玩家总赢得
     this.allxh = 0;    //所有玩家总消耗(总下注-总赢得)
-    
+
     // 下面这两个数据是长度为8的数组,分别代表[苹果,橙子,芒果,铃铛,西瓜,星星,七七,王王]
     this.allyzze = []; //总押注总额列表
     this.allydze = []; //总赢得总额列表(不包含特殊项)
@@ -1053,7 +1053,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
         // console.warn("创建水果机排行榜已发奖励的日期   ");
     }
     this.wjrwxylb = _.fill(Array(this.logic.cardKindCount), 0);//玩家已领未完成任务需要的任务要求列表
-    let opts0 = { 
+    let opts0 = {
         playerId: playerId,
         state:0,//已领未完成
     };
@@ -1071,7 +1071,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
     // console.warn("玩家已领未完成任务需要的任务要求列表  ",ylwwcrwList.length,this.wjrwxylb);
     //统计数据赋初始值结束
     if(this.over > 0){
-        var data = { 
+        var data = {
             diamond: this.nowDiamond2,
             drCount: user.drCount - this.win,
         }
@@ -1079,7 +1079,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
         return { code: C.OK, data: data };
     }
     let drCount = Number(0);
-    let nowTime = Date.now();//当前时间戳  
+    let nowTime = Date.now();//当前时间戳
     let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
     var sgjUser = yield this.app.models.SGJUser.findByIdAsync(this.ownerId, 'jrkbcdrs drCount drTime jzjrldzcz jzjrldzczjlsj lastJoinTime');
     if (sgjUser) {
@@ -1117,7 +1117,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
                     yield sgjUser.saveAsync();
                     // console.warn("带入函数222===  drCount "+drCount+" ssbkdrdd "+ssbkdrdd+" sgjUser.jrkbcdrs "+sgjUser.jrkbcdrs);
                 }
-            } 
+            }
             else{
                 drCount = Math.floor(user.diamond / this.logic.nowCell)*this.logic.nowCell;//1分=10钻石,每日上限1w分)
                 sgjUser.drCount = drCount;
@@ -1194,7 +1194,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
     }
     console.warn("this.nowDiamond2:",this.nowDiamond2)
     console.warn("drCount:",drCount)
-    var data = { 
+    var data = {
         diamond: this.nowDiamond2.toFixed(2),
         drCount: drCount,
     }
@@ -1251,7 +1251,7 @@ proto.startGameAsync = cor(function* (yazhus) {
     this.win = 0;//本局结果赢得分数(不包含下注的即winsList元素总和)用于判断用户是否可以押分
     this.yxjlid = uuid.v1()+'_'+this.id;//ts++游戏记录id
     //ts++设置为游戏状态
-    for (let user of this.users) 
+    for (let user of this.users)
     {
         if (user) {
             user.state = User.STATE.PLAYING
@@ -1273,12 +1273,12 @@ proto.startGameAsync = cor(function* (yazhus) {
     //     this.pjhffileName[this.pjhffileName.length] = this.PJHF.getjsonFileName(0,this.recordid,this.ctime);/////TL++,用于记录玩家牌局回放的json文件名
     //     // console.error("000HHHHHHHHHHHHHHHHHHHHHH",this.pjhffileName.length,this.pjhffileName);
     //     this.PJHF.writePJHFJson(this.getTableInfo(),0,this.id);////在开始第一局的时候将桌子信息写入本地的json文件
-    // } 
-    let nowTime = Date.now();//当前时间戳  
+    // }
+    let nowTime = Date.now();//当前时间戳
     let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
     this.stime = nowTime;
     let scoreBefore = Number(this.nowDiamond) + Number(this.nowDiamond2);//下注之前玩家的钻石
-    this.over++; 
+    this.over++;
     this.yazhus = this.logic.deepCloneTL(yazhus)//玩家本场押注情况
     let bczxz = _.sum(this.yazhus);//本次总下注
     console.warn("bczxz:",bczxz)
@@ -1289,7 +1289,7 @@ proto.startGameAsync = cor(function* (yazhus) {
         cjjcsjk = 2;
         if(jcPools.levels && jcPools.levels.length > 0){
             cjjcsjk = 3;
-            mqdw = this.logic.getMQDW(bczxz,jcPools.levels);//得到目前挡位
+            mqdw = this.logic.getMQDW((bczxz/this.logic.nowCell).toFixed(2),jcPools.levels);//得到目前挡位
         }
     }
     if(cjjcsjk < 3){
@@ -1335,7 +1335,7 @@ proto.startGameAsync = cor(function* (yazhus) {
             ydxLowRate1: [20,20,20],  // 押大小各个挡位对应的牌下限1调控比例(奖池分为几个等级,数组就有几个元素)
             ydxLowRate2: [50,50,50],  // 押大小各个挡位对应的牌下限2调控比例(奖池分为几个等级,数组就有几个元素)
             ydxLowRate3: [80,80,80]  // 押大小各个挡位对应的牌下限3调控比例(奖池分为几个等级,数组就有几个元素)
-           
+
         });
         mqdw = this.logic.getMQDW(bczxz,sgjjc.levels);//得到目前挡位
         yield sgjjc.saveAsync();
@@ -1379,7 +1379,7 @@ proto.startGameAsync = cor(function* (yazhus) {
     this.users[0].drCount = this.nowDiamond.toFixed(2);
     // 水果机战绩
     var sgjtable = new this.app.models.SGJTables({
-        _id: this.yxjlid,//ts++游戏记录id,  
+        _id: this.yxjlid,//ts++游戏记录id,
         tableNo: this.id,     // ts++房间号
         ownerId: this.ownerId,     // 玩家标识
         agentId: this.agentId,     // 代理ID
@@ -1432,7 +1432,7 @@ proto.startGameAsync = cor(function* (yazhus) {
         sgjUser.taskQuan = this.logic.jisuanFloat(sgjUser.taskQuan,addTaskQuan,1);
         this.users[0].taskQuan = sgjUser.taskQuan;
         // sgjUser.taskQuan = 0;//测试时使用
-        nowTaskQuan = sgjUser.taskQuan;        
+        nowTaskQuan = sgjUser.taskQuan;
         if(!this.logic.getListIsSame(sgjUser.yazhuList,this.yazhus)){
             // console.warn("下注列表和之前不一样========   ",sgjUser.yazhuList,this.yazhus);
             sgjUser.yazhuList = this.logic.deepCloneTL(this.yazhus)
@@ -1447,7 +1447,7 @@ proto.startGameAsync = cor(function* (yazhus) {
         //     sgjUser.zfbAcc = "18511090980";
         //     sgjUser.zfbName = "张明";
         //     sgjUser.zfbBindTime = 1698422400000;
-                // sgjUser.taskQuan = 100000;
+        // sgjUser.taskQuan = 100000;
         // }
         sgjUser.getTime = nowTime;   // 获得列表更新的时间
         sgjUser.drCount = this.nowDiamond;
@@ -1579,7 +1579,7 @@ proto.startGameAsync = cor(function* (yazhus) {
     this.zqqCost += bczxz;  //所有玩家游戏转圈总下注
     this.zqqwin += win;   //所有玩家游戏转圈总赢得
     this.zqqxh += bcsy*-1;    //所有玩家游戏转圈总消耗(总下注-总赢得)
-    this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1);   //所有奖券产生总量  
+    this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1);   //所有奖券产生总量
     this.allCost += bczxz;  //所有玩家总下注
     this.allwin += win;   //所有玩家总赢得
     this.allxh += bcsy*-1;    //所有玩家总消耗(总下注-总赢得)
@@ -1587,11 +1587,11 @@ proto.startGameAsync = cor(function* (yazhus) {
         if(!this.allyzze [i]) this.allyzze [i] = 0;
         this.allyzze [i] += this.yazhus[i]
         console.warn("1589 this.allyzze:",this.allyzze)
-    } 
+    }
     for (var i = 0; i < winList.length; i++) {
         if(!this.allydze [i]) this.allydze [i] = 0;
         this.allydze [i] += winList[i]
-    } 
+    }
     if(tspx == 0){//特殊牌型,0:没有,1:小三元,2:大三元,3:大四喜
         this.logic.getGXXXYDZEList(this.gxzydze,xxydList);//总赢得总额列表(不包含特殊项)
         if(handCards[0] == 9 || handCards[0] == 21) {
@@ -1637,7 +1637,7 @@ proto.startGameAsync = cor(function* (yazhus) {
 //
 proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
     // if(!zfbAcc || !zfbName) return { code: C.OK };//该玩家没有支付宝信息
-    let opts0 = { 
+    let opts0 = {
         playerId: playerId,
         state:0,
         wcTime:0
@@ -1675,7 +1675,7 @@ proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
                     let str4 = "table 任务要求出错---id:"+this.id +" 当前局 "+ this.over+"  cd  "+this.wjrwxylb.length+"  playerId  "+playerId;
                     logger.error(str4);////cssj
                 }
-                
+
             }
             else{
                 logger.error("任务主键出错了没有找到记录: "+zj);
@@ -1693,7 +1693,7 @@ proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
         // console.warn("发奖成功信息  ",JSON.stringify(fjres));
         // if(fjres.code == C.OK && fjres.data.success == true){
         //     //发奖成功
-            
+
         //     for (var i = 0; i < overTaskRes.overList.length; i++) {
         //         let xb = overTaskRes.overList[i];
         //         let zj = ylrwList[i]._id;
@@ -1738,7 +1738,8 @@ proto.huafenAsync = cor(function* (type,value) {
     let jcPools = yield this.app.models.SGJJC.findByIdAsync('sgjjcs');
     if (jcPools) {
         if(jcPools.ydxpools && jcPools.ydxpools.length > 0){
-            mqdw = this.logic.getMQDW(value,jcPools.ydxlevels);//得到目前挡位
+            console.warn("value:",value)
+            mqdw = this.logic.getMQDW((value/this.logic.nowCell).toFixed(2),jcPools.ydxlevels);//得到目前挡位
         }
     }
     let res = this.logic.getHuafenRes(type,value,mqdw,jcPools);
@@ -1789,7 +1790,7 @@ proto.huafenAsync = cor(function* (type,value) {
         let newlb = _.cloneDeep(sgjtable.huafenList);
         newlb[newlb.length] = huafenItem;
         sgjtable.huafenList = _.cloneDeep(newlb);
-        yield sgjtable.saveAsync();    
+        yield sgjtable.saveAsync();
     }
 
     let nowTaskQuan = 0;
@@ -1836,7 +1837,7 @@ proto.huafenAsync = cor(function* (type,value) {
     this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1).toFixed(2);   //所有奖券产生总量
     this.allCost += value;  //所有玩家总下注
     if(res.win >= 0) this.allwin += res.win*2;   //所有玩家总赢得
-    this.allxh += res.win*-1;    //所有玩家总消耗(总下注-总赢得) 
+    this.allxh += res.win*-1;    //所有玩家总消耗(总下注-总赢得)
 
     let phdata = {
         bczxz: value.toFixed(2),//本次总下注
@@ -1890,7 +1891,7 @@ proto.tjbjlmryxrs = cor(function* () {
         let opts1 = { registerTime: { $gte: zrStart, $lt: jrStart}};
         let grzcrs = yield this.app.models.SGJUser.countMongoAsync(opts1);
         let opts2 = { registerTime: { $gte: zrStart, $lt: jrStart},
-                    lastPlayTime: { $gte: zrStart, $lt: jrStart}};
+            lastPlayTime: { $gte: zrStart, $lt: jrStart}};
         let xzyxrs = yield this.app.models.SGJUser.countMongoAsync(opts2);
         let opts3 = { lastPlayTime: { $gte: zrStart, $lt: jrStart}};
         let grzqrs = yield this.app.models.SGJUser.countMongoAsync(opts3);
@@ -1956,9 +1957,9 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
                     return true;
                 } else {
                     //不是就返回false
-                  return false;
+                    return false;
                 }
-            } 
+            }
             catch (e) {
                 return false;
             }
@@ -1967,84 +1968,84 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
     }
     // var player = yield this.app.models.sgjUser.findByIdAsync(this.ownerId, 'zfbAcc zfbName');
     // if (player) {
-        let p = this.ownerId; //用户id
-        // let idsList = _.cloneDeep(ywcrwzjlist);//任务主键列表数组
-        let idsStr = "";//JSON.stringify(ywcrwzjlist);//任务主键列表字符串
-        for (var i = 0; i < ywcrwzjlist.length; i++) {
-            let sss = ""+ywcrwzjlist[i];
-            if(i < ywcrwzjlist.length - 1) sss+=",";
-            idsStr+=sss;
-        }
-        let t = type; // 类型 1:绑定支付宝,2:水果游戏任务奖励 
-        let r=""; // 说明
-        let tsT = Date.now();
-
-        let key = "xxxxxxx"
-        let str1 = ""+p+idsStr+key+t+r+tsT;
-        let md51 = md5(str1).toUpperCase();
-        let str2 = ""+md51+tsT;
-        let md52 = md5(str2).toUpperCase();
-        let sign = md52;
-        let post_data={
-            p: p,
-            idsStr:idsStr,
-            t: t,
-            r: r,
-            tsT: tsT,
-            s: sign
-        };//请求数据
-        // console.warn("任务发奖 post_data   "+post_data);
-        let reqdata = JSON.stringify(post_data);
-        let options = {
-            hostname: 'aa.bb.cc.com',
-            port: '',
-            path: '/sfM/giveOut',
-            method: 'POST',
-            rejectUnauthorized: false,
-            requestCert: true,
-            headers: {
-                'Content-Type': 'Application/json',
-                "Content-Length":reqdata.length
+    let p = this.ownerId; //用户id
+    // let idsList = _.cloneDeep(ywcrwzjlist);//任务主键列表数组
+    let idsStr = "";//JSON.stringify(ywcrwzjlist);//任务主键列表字符串
+    for (var i = 0; i < ywcrwzjlist.length; i++) {
+        let sss = ""+ywcrwzjlist[i];
+        if(i < ywcrwzjlist.length - 1) sss+=",";
+        idsStr+=sss;
+    }
+    let t = type; // 类型 1:绑定支付宝,2:水果游戏任务奖励
+    let r=""; // 说明
+    let tsT = Date.now();
+
+    let key = "xxxxxxx"
+    let str1 = ""+p+idsStr+key+t+r+tsT;
+    let md51 = md5(str1).toUpperCase();
+    let str2 = ""+md51+tsT;
+    let md52 = md5(str2).toUpperCase();
+    let sign = md52;
+    let post_data={
+        p: p,
+        idsStr:idsStr,
+        t: t,
+        r: r,
+        tsT: tsT,
+        s: sign
+    };//请求数据
+    // console.warn("任务发奖 post_data   "+post_data);
+    let reqdata = JSON.stringify(post_data);
+    let options = {
+        hostname: 'aa.bb.cc.com',
+        port: '',
+        path: '/sfM/giveOut',
+        method: 'POST',
+        rejectUnauthorized: false,
+        requestCert: true,
+        headers: {
+            'Content-Type': 'Application/json',
+            "Content-Length":reqdata.length
+        }
+    };
+    var req = https.request(options, function (res) {
+    });
+    req.write(reqdata);
+    req.on('response', function (response2) {
+        // console.warn("请求到这里了???222 response2.headers   "+JSON.stringify(response2.headers) );
+        req.end();
+        let body2 = "";
+        response2.on('data', function (chunk) {
+            body2 = chunk.toString();
+            // console.warn("请求到这里了???555 chunk   "+body2);
+            if(!getIsAJsonStr22(body2)){
+                console.error("接口返回值非json字符串   "+body2);
+                return {code: C.ERROR, msg: 114 };//"验证码发送失败"
             }
-        };
-        var req = https.request(options, function (res) {
-        });
-        req.write(reqdata);
-        req.on('response', function (response2) {
-            // console.warn("请求到这里了???222 response2.headers   "+JSON.stringify(response2.headers) );
-            req.end();
-            let body2 = "";
-            response2.on('data', function (chunk) {
-                body2 = chunk.toString();
-                // console.warn("请求到这里了???555 chunk   "+body2);
-                if(!getIsAJsonStr22(body2)){
-                    console.error("接口返回值非json字符串   "+body2);
-                    return {code: C.ERROR, msg: 114 };//"验证码发送失败"
-                }
-                let result = JSON.parse(body2);
-                // console.warn("请求到这里了???56 chunk   "+result.success);
-                if(result.success){
-                    // console.warn("任务发奖成功  "+this.ownerId+"  "+JSON.stringify(result) );
-                    
-                    return { code: C.OK, data: result};
-                }
-                else{
-                    console.error("任务发奖出错了   "+body2);
-                    return {code: C.ERROR, msg: 115 };//"验证码发送失败"
-                }
-                // console.warn("这里都到返回值了222  ")
-                
-            });
-            // console.warn("请求到这里了???666 body2 "+body2)
-        });
-        req.on('error', function (e) {
-            req.end();
-            console.error(new Error('request FJ error: ' + e.message));
-            return { code: C.ERROR, msg: 116 };//"请求验证码失败"
+            let result = JSON.parse(body2);
+            // console.warn("请求到这里了???56 chunk   "+result.success);
+            if(result.success){
+                // console.warn("任务发奖成功  "+this.ownerId+"  "+JSON.stringify(result) );
+
+                return { code: C.OK, data: result};
+            }
+            else{
+                console.error("任务发奖出错了   "+body2);
+                return {code: C.ERROR, msg: 115 };//"验证码发送失败"
+            }
+            // console.warn("这里都到返回值了222  ")
+
         });
+        // console.warn("请求到这里了???666 body2 "+body2)
+    });
+    req.on('error', function (e) {
+        req.end();
+        console.error(new Error('request FJ error: ' + e.message));
+        return { code: C.ERROR, msg: 116 };//"请求验证码失败"
+    });
     // }
     // console.warn("请求支付宝完成了  ")
-    var data = { 
+    var data = {
         // renwuPool: allRenWuInfo,
     }
     return { code: C.OK, data: data };
@@ -2063,7 +2064,7 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
 // //ts++写分   endtype = { 正常: 0,局数完成: 1, 房主解散: 2, 申请解散: 3 ,超时解散: 4 };
 // proto.writeResultAsync2 = cor(function* (endmode) {
 //     logger.warn("牌局写入-------------- " + this.id );
-//     // console.warn("ts++---------牌局写入writeResultAsync",this.id);   
+//     // console.warn("ts++---------牌局写入writeResultAsync",this.id);
 //     let gameCost=0;//游戏消耗
 //     let giftCost = 0;////道具消耗
 //     this.etime = Date.now();
@@ -2079,9 +2080,9 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
 //             giftCost+=scorer.giftCost;
 //             let userscore=scorer.score;
 //             // if(this.gameKindTL == 2) userscore -= 200;
-//             users.push({_id: scorer.playerId,chairId:scorer.chairId,userId: scorer.userId, name: scorer.name, sex: scorer.sex, headurl: scorer.headurl,over: scorer.over, score: userscore}); 
+//             users.push({_id: scorer.playerId,chairId:scorer.chairId,userId: scorer.userId, name: scorer.name, sex: scorer.sex, headurl: scorer.headurl,over: scorer.over, score: userscore});
 //             //, gameCost: scorer.gameCost,giftCost: scorer.giftCost,diamond: scorer.diamond
-//             localUsers.push({_id: scorer.playerId,userId: scorer.userId, name: scorer.name, gameCost: scorer.gameCost,giftCost: scorer.giftCost,}); 
+//             localUsers.push({_id: scorer.playerId,userId: scorer.userId, name: scorer.name, gameCost: scorer.gameCost,giftCost: scorer.giftCost,});
 //         }
 //     }
 //     // if(this.isGameOk)////以前是解散的不算返利
@@ -2107,7 +2108,7 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
 //         this.lconfigCommon = new configCommon(this.app);
 //     }
 //     yield this.lconfigCommon.yxActivityAsync(scorers,this.etime);
-    
+
 //     logger.warn("战绩写入结束--",this.id);
 //     // return { code: C.OK };
 
@@ -2150,19 +2151,19 @@ proto.endResultAsync = cor(function* (endmode) {
         {
             yield this.pushMsgAsync(-1, 'shuiguo_event', { type: M.TABLE_JIESAN });
         }
-        
+
         if(this.leaveUsers.length>0)
         {
-             this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
+            this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
         }
         var gametable = yield this.app.models.GameTable.findByIdAsync(this.recordid, '_id tableNo agentId endMode');
         if(gametable){
             gametable.endMode = 1;
             yield gametable.saveAsync();
         }
-        this.game.deleteTable(this.id);//ts++删除房间    
+        this.game.deleteTable(this.id);//ts++删除房间
         // let str5 = "table 结束信息22  关闭-id:"+this.id +"结算模式"+endmode;
-        // logger.info(str5);////cssj    
+        // logger.info(str5);////cssj
     }
     else//普通结束
     {
@@ -2183,10 +2184,10 @@ proto.endResultAsync = cor(function* (endmode) {
             }
         }
     }
-    
+
     let str7 = "table end 结束信息---id:%s  "+this.id +" 结算模式 "+endmode;
     logger.warn(str7);////cssj
-    
+
 });
 
 //ts++离开用户退出定时器
@@ -2203,19 +2204,19 @@ proto.leaveUserTimeAsync = cor(function* () {
 
     if(this.leaveUsers.length>0)
     {
-         this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
+        this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
     }
 
 });
 
 // 玩家信息,里面包含任务信息
 proto.roleInfoAsync = cor(function* (playerId,chairId) {
-     // console.log("玩家信息玩家信息玩家信息");
+    // console.log("玩家信息玩家信息玩家信息");
     var user = this.users[chairId];
     if (!user) {
         return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
     }
-    var data = { 
+    var data = {
         cost:0,
         win:0,
         zfbAcc:"",
@@ -2256,7 +2257,7 @@ proto.setPaiHangData = cor(function* (data) {
     if (paihang) {
         if(data.jrStart == paihang.time1){
             let newcost1 = Number(paihang.cost1) +  Number(data.bczxz);
-            let newQuan = this.logic.jisuanFloat(paihang.quan1,data.addTaskQuan,1); 
+            let newQuan = this.logic.jisuanFloat(paihang.quan1,data.addTaskQuan,1);
             paihang.cost1 = newcost1;
             paihang.quan1 = newQuan;
         }
@@ -2302,7 +2303,7 @@ proto.setPaiHangData = cor(function* (data) {
         }
         let limit = 10;//前10名上榜
         let zrStart = data.jrStart - 86400000;////更新今日0时的时间戳
-        var opts = { 
+        var opts = {
             time1: zrStart,
             quan1: { $gt: 0}
         };
@@ -2357,7 +2358,7 @@ proto.sendPHBJL = cor(function* (list,_index) {
 proto.getPaiHangAsync = cor(function* (playerId) {
     let limit = 10;//前10名上榜
     let jrStart = this.logic.getTodaySJC();////更新今日0时的时间戳
-    var opts = { 
+    var opts = {
         time1: jrStart,
         quan1: { $gt: 0}
     };
@@ -2395,7 +2396,7 @@ proto.getPaiHangAsync = cor(function* (playerId) {
 
 // 上传真实姓名支付宝账号
 proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
-     // console.log("上传真实姓名支付宝账号");
+    // console.log("上传真实姓名支付宝账号");
     let opts = { zfbAcc: zfbAcc,zfbName: realName};
     let fields = 'zfbAcc zfbName';
     var sgjUserList = yield this.app.models.SGJUser.findMongoAsync(opts, fields, { limit: 1 });
@@ -2408,7 +2409,7 @@ proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
         yield sgjUser.saveAsync();
     }
     yield this.sendTaskRecord(1,[]);
-    var data = { 
+    var data = {
         zfbAcc:zfbAcc,
         zfbName:realName
     }
@@ -2417,22 +2418,22 @@ proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
 
 // 得到任务列表
 proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
-      console.log("玩家信息玩家信息玩家信息");
+    console.log("玩家信息玩家信息玩家信息");
     var user = this.users[chairId];
     if (!user) {
         return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
     }
-    
+
     // var xxxrw = yield this.app.models.SGJTask.findByIdAsync("7abfd0a0-fe1a-11ee-996a-93780804e29f", 'fjTime state');
     // if(xxxrw){
     //     xxxrw.state = 1;
     //     xxxrw.fjTime = 0;
     //     yield xxxrw.saveAsync();
     //     console.warn("dakmaijfnaisfnainijn");
-        
+
     //     // yield this.app.models.SGJTask.removeAsync({_id : "abce01f0-31f8-11ef-abd5-954f4bbeb2b1"});
     // }
-    let opts0 = { 
+    let opts0 = {
         playerId: playerId,
         // state:0,//已领未完成
         // wcTime:0,
@@ -2441,7 +2442,7 @@ proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
     var ylwwcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'des cost reachs reachC rewardt rewards state');
     // console.warn("该wanjia已领取未完成或未发奖的列表   length   "+ylwwcrwList.length+"   ylrwList  "+JSON.stringify(ylwwcrwList))
     let jrStart = this.logic.getTodaySJC();////更新今日0时的时间戳
-    let opts1 = { 
+    let opts1 = {
         playerId: playerId,
         state:3,
         wcTime:{ $gte: jrStart, $lt: jrStart+86400000}
@@ -2473,7 +2474,7 @@ proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
             sgjwjjrrwc.time = jrStart;
             yield sgjwjjrrwc.saveAsync();
         }
-        
+
     }
     else{
         rwcList = this.logic.getWJJRRWC(ylrwList,klqhbjl);
@@ -2485,7 +2486,7 @@ proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
         yield newsgjwjjrrwc.saveAsync();
     }
     let allRenWuInfo = this.logic.getTasksInfo(ylrwList,rwcList)//该任务最多领取次数
-    var data = { 
+    var data = {
         renwuPool: allRenWuInfo,
     }
     return { code: C.OK, data: data };
@@ -2506,7 +2507,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
             if(sgjwjjrrwc.rwcList.length > 0) {
                 alltasks = this.logic.deepCloneTL2(sgjwjjrrwc.rwcList);
             }
-           
+
         }
     }
     let allCountInfo = this.logic.getATaskAllCount(item,alltasks)//该任务最多领取次数
@@ -2528,7 +2529,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
     // if(!zfbAcc || !zfbName || !zfbBindTime){
     //     return { code: C.FAILD, msg: "未绑定支付宝信息" };//领任务的时候绑定支付宝信息
     // }
-    let opts0 = { 
+    let opts0 = {
         playerId: playerId,
         cost: item.cost,
         // reachs: item.reachs,
@@ -2542,7 +2543,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
     var ylwwcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'playerId cost reachs reachC rewards state ');
     if(ylwwcrwList.length > 0) return { code: C.FAILD, msg: "请完成该任务之后再领取" };
     let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
-    let opts1 = { 
+    let opts1 = {
         playerId: playerId,
         cost: item.cost,
         // reachs: item.reachs,
@@ -2621,7 +2622,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
         SGJUserTongji = SGJUserTongjis[0]
         console.warn("SGJUserTongji:",SGJUserTongji)
         //SGJUserTongji.usdt = user.diamond,
-            SGJUserTongji.taskquanlose = (Number(SGJUserTongji.taskquanlose) +Number(cost)).toFixed(2)//下注
+        SGJUserTongji.taskquanlose = (Number(SGJUserTongji.taskquanlose) +Number(cost)).toFixed(2)//下注
         SGJUserTongji.nowtaskquan = nowTaskQuan
         yield SGJUserTongji.saveAsync()
     }
@@ -2635,7 +2636,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
     }
     // console.warn("领取任务  玩家已领未完成任务需要的任务要求列表  ",this.wjrwxylb);
     ylcs++;
-    var data = { 
+    var data = {
         nowTaskQuan:nowTaskQuan.toFixed(2),
         ylcs : ylcs,//该任务已领取的次数
         renwuInfo: item
@@ -2661,7 +2662,7 @@ proto.renWuLingjiangAsync = cor(function* (playerId,chairId,item) {
         zfbName = sgjUser.zfbName;
         zfbBindTime = sgjUser.zfbBindTime;
     }
-    let opts0 = { 
+    let opts0 = {
         playerId: playerId,
         cost: item.cost,
         reachs: { $all: item.reachs},
@@ -2706,8 +2707,8 @@ proto.renWuLingjiangAsync = cor(function* (playerId,chairId,item) {
         }
         let fjres = yield this.sendTaskRecord(2,[ywcrwList[0]._id]);
     }
-   
-    var data = { 
+
+    var data = {
         rewardt:rewardt,
         renwuInfo: item
     }
@@ -2716,7 +2717,7 @@ proto.renWuLingjiangAsync = cor(function* (playerId,chairId,item) {
 
 // 得到玩家已完成的任务列表
 proto.getOverTasksAsync = cor(function* (playerId,chairId) {
-     // console.log("玩家信息玩家信息玩家信息");
+    // console.log("玩家信息玩家信息玩家信息");
     var user = this.users[chairId];
     if (!user) {
         return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
@@ -2736,14 +2737,14 @@ proto.getOverTasksAsync = cor(function* (playerId,chairId) {
     //         yield sgjwjjrrwc.saveAsync();
     //     }
     // }
-    let opts0 = { 
+    let opts0 = {
         playerId: playerId,
         state: { $gt: 2 },
         wcTime:{ $gt: 2 }
     };
     var ywcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'cost reachs reachC rewardt rewards state lqTime wcTime fjTime',{sort: { lqTime: -1 },limit:30});
     // console.warn("该wanjia已经完成的列表   length   "+ywcrwList.length+"   ywcrwList  "+JSON.stringify(ywcrwList))
-    var data = { 
+    var data = {
         ywcrwList: ywcrwList,
     }
     return { code: C.OK, data: data };

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 407 - 378
http/charge.js


+ 13 - 1
http/manage.js

@@ -587,6 +587,7 @@ proto.setWeiHuAsync = P.coroutine(function* (query, method, res) {
 
 // 后台增加钻石
 proto.addDiamondAsync = P.coroutine(function* (query, method, res) {
+	console.warn("590 query:",query)
 	var playerId = query['playerid'];
 	if (!playerId) {
 		return this.writeOut('fail: userid error!', res);
@@ -604,6 +605,7 @@ proto.addDiamondAsync = P.coroutine(function* (query, method, res) {
 	if (!checkSign(sign)) {
 		return this.writeOut('fail: sign error!', res);
 	}
+	console.warn("query:",query)
 	// console.warn("后台增加钻石-------------------diamond:",diamond);
 	var self = this;
 	var app = this.app;
@@ -630,10 +632,12 @@ proto.addDiamondAsync = P.coroutine(function* (query, method, res) {
 	    	}
 	    }
 		else if(diamond > 0){
+			console.warn("playerId:",playerId)
 			var player = yield app.models.Player.findByIdAsync(playerId, 'userId');
 			if (player) {
 				var mail = yield app.models.Mails.findByIdAsync(playerId, 'mailInfos');
 				if (mail) {
+					console.warn("638")
 					let item = {
 						_id: "",
 						index: mail.mailInfos.length, // 邮件下标
@@ -882,8 +886,14 @@ proto.setSGJiangChiAsync = P.coroutine(function* (query, method, res) {
 	    	if(type == 1){//游戏奖池
 				if(key >= 1 && key <= 3){
 					let list = [jcPools.pools,jcPools.levels,jcPools.cspools]
+					console.warn("list:",list)
+					console.warn(" index:",index," key:",key)
 					if(index > 0 && index <= list[key-1].length && list[key-1][index-1] != value){
 						list[key-1][index-1] = value;
+						// ✅ 关键:告诉模型数组变了
+						console.warn("list:",list)
+						console.warn("value:",value)
+						console.warn("jcPools.pools:",jcPools.pools)
 						isUp = true;
 					}
 				}
@@ -926,7 +936,9 @@ proto.setSGJiangChiAsync = P.coroutine(function* (query, method, res) {
 	    		let jcPools2 = yield app.models.SGJJC.findByIdAsync('sgjjcs');
 	    		if(type == 1){//游戏奖池
 	    			if(key >= 1 && key <= 3){
+	    				console.warn("935 jcpools.pools:",jcPools.pools)
 	    				jcPools2.pools = _.cloneDeep(jcPools.pools);
+	    				console.warn("jcPools:",jcPools)
 	    				jcPools2.levels = _.cloneDeep(jcPools.levels);
 	    				jcPools2.cspools = _.cloneDeep(jcPools.cspools);
 	    			}
@@ -950,7 +962,6 @@ proto.setSGJiangChiAsync = P.coroutine(function* (query, method, res) {
 						jcPools2.bsLowRate2 = _.cloneDeep(jcPools.bsLowRate2);
 						jcPools2.bsLowRate3 = _.cloneDeep(jcPools.bsLowRate3);
 	    			}
-
 	    		}
 				else if(type == 2){//押大小奖池
 					if(key >= 1 && key <= 3){
@@ -973,6 +984,7 @@ proto.setSGJiangChiAsync = P.coroutine(function* (query, method, res) {
 						jcPools2.ydxLowRate3 = _.cloneDeep(jcPools.ydxLowRate3);
 					}
 				}
+				console.warn("修改之后 jcPools2:",jcPools2)
 	    		yield jcPools2.saveAsync();
 	    		// console.warn("奖池更新了",jcPools);
 	    		// console.warn("奖池更新了222   ",jcPools2);

+ 1 - 0
share/constant.js

@@ -19,6 +19,7 @@ module.exports = {
 	PLAYER_NOT_BANKING:						'209',						// 玩家不在抢庄中
 	PLAYER_NOT_CALLING:						'210',						// 玩家不在叫倍中
 	PLAYER_NOT_LOGIN:						'211',						// 玩家未登录
+	SERVER_WEIHU:							'212',						// 服务器维护
 
 	TABLE_NOT_FOUND:						'301',						// 桌子未找到
 	TABLE_HAS_ALREADY:						'302',						// 已经在桌子上

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä