File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
src/main/java/org/b3log/symphony/processor Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -962,14 +962,6 @@ public synchronized void openRedPacket(final RequestContext context) {
962962 }*/
963963 }
964964
965- if ("heartbeat" .equals (redPacket .getString ("type" )) || "rockPaperScissors" .equals (redPacket .getString ("type" ))) {
966- // 如果要抢石头剪刀布红包,先看账户余额是否大于平均数
967- if (currentUser .optInt (UserExt .USER_POINT ) < redPacket .optInt ("money" )) {
968- context .renderJSON (StatusCodes .ERR ).renderMsg ("抢红包失败!你的账户余额低于该红包金额。" );
969- return ;
970- }
971- }
972-
973965 // 开始领取红包
974966 int meGot = 0 ;
975967 if ("average" .equals (redPacket .getString ("type" ))) {
@@ -1077,6 +1069,11 @@ public synchronized void openRedPacket(final RequestContext context) {
10771069 meGot = RED_PACKET_BUCKET .get (oId ).packs .poll ();
10781070 }
10791071 } else if ("rockPaperScissors" .equals (redPacket .getString ("type" ))) {
1072+ if (currentUser .optInt (UserExt .USER_POINT ) < redPacket .optInt ("money" )) {
1073+ context .renderJSON (StatusCodes .ERR ).renderMsg ("抢红包失败!你的账户余额低于该红包金额。" );
1074+ return ;
1075+ }
1076+
10801077 if (redPacketIsOpened (who , userId )) {
10811078 context .renderJSON (new JSONObject ().put ("who" , who ).put ("info" , info ));
10821079 return ;
@@ -1103,6 +1100,10 @@ public synchronized void openRedPacket(final RequestContext context) {
11031100 meGot = -money ;
11041101 }
11051102 } else {
1103+ if (currentUser .optInt (UserExt .USER_POINT ) < redPacket .optInt ("money" )) {
1104+ context .renderJSON (StatusCodes .ERR ).renderMsg ("抢红包失败!你的账户余额低于该红包金额。" );
1105+ return ;
1106+ }
11061107 if (redPacketIsOpened (who , userId )) {
11071108 context .renderJSON (new JSONObject ().put ("who" , who ).put ("info" , info ));
11081109 return ;
You can’t perform that action at this time.
0 commit comments