room.php 3.98 KB
<?php
use yii\helpers\Html;
use backend\widgets\LinkPager;
use backend\widgets\YHGImage\Common\Images as CommonImages;

$this->title = $this->params['main_title'].'-'.$this->params['sub_title'];
?>

<div class="panel panel-default">
    <div class="panel-body">
        <form action="" method="GET" class="form-inline">
            <div>
                <?=$filter?>
            </div>
        </form> 
    </div>
</div>

<div class="form-group">
    <label>
        <a href="/live/roomcreate" class="btn btn-primary">+ 创建房间</a>
    </label>
</div>

<div class="row">
    <div class="col-md-12">
        <div class="table-responsive">
            <table class="table mb30">
                <thead>
                    <tr style="white-space:nowrap">
                        <th><input type="checkbox" onclick="checkall(this)">选择</th>
                        <th>房间号</th>
                        <th>APP</th>
                        <th>直播标题</th>
                        <th>头图</th>
                        <th>主播</th>
                        <th>预告开始时间</th>
                        <th>房间密钥</th>
                        <th>是否精选</th>
                        <th>马甲状态</th>
                        <th>直播状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($list as $model):?>
                    <tr data-stock="1" data-source="1" data-status="2" data-id="5011880">
                        <td><input type="checkbox" value="<?=$model->id?>" name="room[]"></td>
                        <td><?=$model->room_id?></td>
                        <td><?=$model->app?></td>
                        <td><?=$model->title?></td>
                        <td><img height="70" alt="房间封面图片" src="<?=CommonImages::getImageUrl($model->pic, 70, 70, 2)?>"></td>
                        <td><?=$model->master ? $model->master->master_id.' '.$model->master->name : '无主播'?></td>
                        <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><?=Yii::$app->params['config']['room_living'][$model->living]?></td>
                        <td>
                            
                            <a href="/live/roomedit/<?=$model->id?>" class="btn btn-default btn-white">编辑</a>

                            <a href="/forbidden/index?room_id=<?=$model->room_id?>" class="btn btn-default btn-white">禁言</a>
                            
                            <a href="/product/list/<?=$model->room_id?>" class="btn btn-default btn-white">商品</a>
                         
                            <span>
                                <?php if ($model->status == 0)://未开始?>
                                <a onclick="return confirm('启用直播间?')" href="/live/roomoperate/<?=$model->id?>?type=enable" class="btn btn-success btn-metro">启用直播</a>
                                <a onclick="return confirm('删除直播间?')" href="/live/roomoperate/<?=$model->id?>?type=del" class="btn btn-danger btn-metro">删除</a>
                                <?php else:?>
                                <a onclick="return confirm('禁用直播间?')" href="/live/roomoperate/<?=$model->id?>?type=disable" class="btn btn-danger btn-metro">禁用直播</a>
                                <?php endif;?>
                            </span>
                        </td>
                    </tr>
                    <?php endforeach;?>
                </tbody>
            </table>
        </div>
        <!-- table-responsive -->
        <?php echo LinkPager::widget(['pagination' => $pagination]);?>
    </div>
    <!-- col-md-12 -->
</div>