Authored by xiaofeng.yao@yoho.cn

1、增加”累加人数“字段,

2、获取正在直播房间接口返回是否累加人数字段
... ... @@ -39,7 +39,7 @@ class Room extends \yii\db\ActiveRecord
public function rules()
{
return [
[['room_id', 'master_id', 'starting_time', 'best', 'vest', 'living', 'status', 'create_time', 'update_time'], 'integer'],
[['room_id', 'master_id', 'starting_time', 'best', 'vest', 'is_addup', 'living', 'status', 'create_time', 'update_time'], 'integer'],
[['title', 'watermark'], 'string', 'max' => 100],
[['app', 'secret'], 'string', 'max' => 50],
[['pic', 'background_pic'], 'string', 'max' => 255],
... ... @@ -234,7 +234,11 @@ class Room extends \yii\db\ActiveRecord
throw new \Exception('精选房间上限是2个');
}
}
if (isset($data['is_addup'])){
$data['is_addup'] = Yii::$app->params['config']['is_addup'];
}else{
$data['is_addup'] = 0;
}
$this->setAttributes($data);
if (!$this->save()){
throw new \Exception(current($this->getFirstErrors()));
... ...
... ... @@ -81,7 +81,7 @@ $this->registerJs($this->blocks['javascript'],View::POS_END)
<th>预告开始时间</th>
<th>房间密钥</th>
<th>是否精选</th>
<th>马甲状态</th>
<th>马甲状态|人数累加</th>
<th>直播状态</th>
<th>在线人数</th>
<th>操作</th>
... ... @@ -99,7 +99,12 @@ $this->registerJs($this->blocks['javascript'],View::POS_END)
<td style="white-space:nowrap"><?=$model->starting_time ? date('Y-m-d H:i:s',$model->starting_time) : ''?></td>
<td><?=$model->secret?></td>
<td><?=Yii::$app->params['config']['best'][$model->best]?></td>
<td><?=Yii::$app->params['config']['vest'][$model->vest]?></td>
<td>
<?php
$is_addup = $model->is_addup == Yii::$app->params['config']['is_addup'] ? "是":"否";
echo Yii::$app->params['config']['vest'][$model->vest]."|".$is_addup;
?>
</td>
<td><?=Yii::$app->params['config']['room_living'][$model->living]?></td>
<td>
真实:<?=@$model->roomNums->online_num ? :0?>,
... ...
... ... @@ -107,8 +107,11 @@ $this->registerJs($this->blocks['javascript'],View::POS_END)
<div class="col-sm-2">
<?php echo Html::dropDownList('vest', $model->vest,Yii::$app->params['config']['vest'], ['class' => 'form-control']);?>
</div>
<div class="col-sm-2">
累加人数:<?php echo Html::checkbox('is_addup', $model->is_addup==Yii::$app->params['config']['is_addup'],['value'=>Yii::$app->params['config']['is_addup']])?>
</div>
</div>
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label">直播状态: </label>
<div class="col-sm-2">
... ...
... ... @@ -291,6 +291,7 @@ class RoomController extends BaseController
$row = [
'room_id'=>(int)$model->room_id,
'vest'=>$model->vest,
'is_addup'=>$model->is_addup
];
$list[$k] = $row;
}
... ...