Authored by wuxiao

Merge branch 'test' of http://git.yoho.cn/web/yoho-live into test

... ... @@ -57,7 +57,6 @@ class ForbiddenController extends BaseController
die('缺少room_id');
}
}
/**
... ... @@ -121,8 +120,8 @@ class ForbiddenController extends BaseController
$gets = Yii::$app->request->get();
$room_id = $gets['room_id'];
if($room_id) {
$sqlwhere = ['cmd' => 5];
//$sqlwhere = ['cmd' => 5];
$sqlwhere = [];
$count = (new \yii\db\Query())
->from($this->getTableName($room_id))
->where($sqlwhere)
... ...
... ... @@ -171,8 +171,17 @@ class LiveController extends BaseController
$model = new Master();
if ($posts = Yii::$app->request->post()) {
$model->name = $posts['name'];
$model->meta = $posts['meta'];
if(empty($posts['pic']) || empty($posts['name'])){
Yii::$app->session->setFlash('warning', '昵称或头像不能为空');
return $this->redirect('/live/addmaster');
}
$master = Master::findOne(['name'=>$posts['name']]);
if(!empty($master)){
Yii::$app->session->setFlash('warning', '主播名称已存在');
return $this->redirect('/live/addmaster');
}
$model->name = trim($posts['name']);
$model->meta = trim($posts['meta']);
$model->pic = $posts['pic'];
$model->create_time = $model->update_time = time();
if($model->save()){
... ...
... ... @@ -20,7 +20,15 @@ use backend\widgets\LinkPager;
<?php foreach($list as $v):?>
<tr>
<td><?php echo $v['name']."(".$v['uid'].")"?></td>
<td><?php echo $v['comment']?></td>
<td>
<?php
if($v['cmd']==5){
echo $v['comment'];
}elseif($v['cmd']==4){
echo '@'.$v['name'].'加入了房间';
}
?>
</td>
<td><?php echo date('Y-m-i H:i:s',$v['create_time'])?></td>
<td><button class="btn btn-danger jinyan" uid="<?php echo $v['uid']?>" name="<?php echo $v['name']?>" room_id="<?php echo $v['room_id']?>">禁言</button></td>
</tr>
... ...