...
|
...
|
@@ -89,7 +89,7 @@ class LivingController extends BaseController |
|
|
}else{
|
|
|
Yii::$app->db->cache(function() use (&$ret){
|
|
|
$_ret = json_decode($ret,true);
|
|
|
$models = RoomNums::find()->where(['app'=>$this->app])->indexBy('room_id')->all();
|
|
|
$models = RoomNums::find()->indexBy('room_id')->all();
|
|
|
foreach ($_ret as $k=>$row){
|
|
|
if (!empty($models[$row['room_id']]->online_num)){
|
|
|
$row['audience_num'] = (int)$models[$row['room_id']]->online_num;//在线人数
|
...
|
...
|
@@ -216,11 +216,16 @@ class LivingController extends BaseController |
|
|
'rtmp_downstream_address'=>'',
|
|
|
'flv_downstream_address'=>'',
|
|
|
'hls_downstream_address'=>'',
|
|
|
'live_last_time'=>0,
|
|
|
];
|
|
|
|
|
|
//直播时长(秒)
|
|
|
if ($model->living == 2){
|
|
|
$ret['live_last_time'] = $model->videoLast ? $model->videoLast->live_end_time-$model->videoLast->live_start_time : 0;
|
|
|
if ($model->videoLast){
|
|
|
$ret['live_last_time'] = max($model->videoLast->live_end_time-$model->videoLast->live_start_time,0);
|
|
|
$ret['like_num'] = $model->videoLast->like_num;
|
|
|
$ret['audience_num'] = $model->videoLast->audience_num;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*if ($model->roomNums){
|
...
|
...
|
|