Authored by wuxiao

红包推送后台修复bug

... ... @@ -59,6 +59,7 @@ class RedbagController extends BaseController
$couponId_by_type[$model->type_id][] = $model->coupon_id;
}
}
if ($couponId){
$ret = YohoApiClient::self()->couponList($couponId);
... ... @@ -76,14 +77,15 @@ class RedbagController extends BaseController
]);
}
}
//页面随机红包池过滤掉无库存的
foreach ($couponId_by_type as $k=>$type_group){
$couponId_by_type[$k] = array_filter($type_group,function($value) use ($list){
return !empty($list[$value]) && $list[$value]->stock;
});
}
}
//页面随机红包池过滤掉无库存的
foreach ($couponId_by_type as $k=>$type_group){
$couponId_by_type[$k] = array_filter($type_group,function($value) use ($list){
return !empty($list[$value]) && $list[$value]->stock;
});
}
}
$types = RedbagType::getId2name();
... ...
... ... @@ -25,7 +25,7 @@ var port = socket_arr[1];
function callWebsocket(sendCallback,afterSendCallback = function(){},errorSendCallback = function(){}){
if (!window.ws || window.ws.readyState === undefined || window.ws.readyState != 1) {
websocket(wsAddr,port,'/',function(){
consoleLog('连接服务器');
consoleLog('连接服务器'+wsAddr+':'+port);
sendCallback();
},function(evt){
... ...
... ... @@ -49,7 +49,7 @@ function sendProduct(product_id){
i++;
if (i>5){
$('#runtime').html('');
$('#wsRuntime').html('');
i = 1;
}
... ...
... ... @@ -49,7 +49,7 @@ function sendRedbag(){
i++;
if (i>5){
$('#runtime').html('');
$('#wsRuntime').html('');
i = 1;
}
... ... @@ -57,7 +57,7 @@ function sendRedbag(){
consoleLog('');
consoleLog('发起推送,优惠券ID: '+coupon_id);
cmd = {cmd:10011,room:room_id,skn:coupon_id};
cmd = {cmd:10011,room:room_id,couponId:String(coupon_id)};
cmd = makeSign(cmd);
cmd = JSON.stringify(cmd);
... ...