发送红包逻辑修改,由随机一个用户发送红包==>向全体用户发送红包
Showing
1 changed file
with
3 additions
and
3 deletions
@@ -45,7 +45,7 @@ function sendRedbag(){ | @@ -45,7 +45,7 @@ function sendRedbag(){ | ||
45 | } | 45 | } |
46 | 46 | ||
47 | //同类型组内随机一个红包 | 47 | //同类型组内随机一个红包 |
48 | - var coupon_id = couponId_by_type[type_id][array_rand(couponId_by_type[type_id])]; | 48 | + var coupons = implode(',',couponId_by_type[type_id]); |
49 | 49 | ||
50 | i++; | 50 | i++; |
51 | if (i>5){ | 51 | if (i>5){ |
@@ -55,9 +55,9 @@ function sendRedbag(){ | @@ -55,9 +55,9 @@ function sendRedbag(){ | ||
55 | 55 | ||
56 | callWebsocket(function(){ | 56 | callWebsocket(function(){ |
57 | consoleLog(''); | 57 | consoleLog(''); |
58 | - consoleLog('发起推送,优惠券ID: '+coupon_id); | 58 | + consoleLog('发起推送,优惠券ID: '+coupons); |
59 | 59 | ||
60 | - cmd = {cmd:10011,room:room_id,couponId:String(coupon_id)}; | 60 | + cmd = {cmd:10011,room:room_id,coupons:coupons}; |
61 | cmd = makeSign(cmd); | 61 | cmd = makeSign(cmd); |
62 | 62 | ||
63 | cmd = JSON.stringify(cmd); | 63 | cmd = JSON.stringify(cmd); |
-
Please register or login to post a comment