Toggle navigation
Toggle navigation
This project
Loading...
Sign in
web
/
yoho-live
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
wuxiao
8 years ago
Commit
0f8b45abbc2921f94f9efb1d51b8afbaacada986
1 parent
4b908fc2
红包推送后台修复bug
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
backend/controllers/RedbagController.php
backend/views/layouts/websocket.php
backend/views/product/list.php
backend/views/redbag/list.php
backend/controllers/RedbagController.php
View file @
0f8b45a
...
...
@@ -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
();
...
...
backend/views/layouts/websocket.php
View file @
0f8b45a
...
...
@@ -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){
...
...
backend/views/product/list.php
View file @
0f8b45a
...
...
@@ -49,7 +49,7 @@ function sendProduct(product_id){
i++;
if (i>5){
$('#
r
untime').html('');
$('#
wsR
untime').html('');
i = 1;
}
...
...
backend/views/redbag/list.php
View file @
0f8b45a
...
...
@@ -49,7 +49,7 @@ function sendRedbag(){
i++;
if (i>5){
$('#
r
untime').html('');
$('#
wsR
untime').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);
...
...
Please
register
or
login
to post a comment