Authored by xiaofeng.yao@yoho.cn

修复列表数据为空时错误调用redis mget的问题【by yaoxiaofeng】

... ... @@ -100,7 +100,7 @@ class LivingController extends BaseController
$keys[] = sprintf("%s:online_nums_room_%s",Yii::$app->params['cache_prefix'],$row['room_id']);
}
$keys ? call_user_func_array(array(Yii::$app->redisIm,'mget'), $keys) : [];
$values = $keys ? call_user_func_array(array(Yii::$app->redisIm,'mget'), $keys) : [];
foreach ($values as $k=>$value){
$_ret[$k]['audience_num'] = (int)($value ? : $_ret[$k]['audience_num']);
}
... ... @@ -183,7 +183,7 @@ class LivingController extends BaseController
foreach ($_ret as $k=>$row){
$keys[] = sprintf("%svideo_id_%s_audience_num",Yii::$app->params['cache_prefix'],$row['video_id']);
}
$keys ? call_user_func_array(array(Yii::$app->redis,'mget'), $keys) : [];
$values = $keys ? call_user_func_array(array(Yii::$app->redis,'mget'), $keys) : [];
foreach ($values as $k=>$value){
$_ret[$k]['audience_num'] = (int)($value ? : $_ret[$k]['audience_num']);
}
... ...