video.php
4.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
use backend\widgets\YHGImage\Common\Images as CommonImages;
use backend\widgets\LinkPager;
use yii\helpers\ArrayHelper;
if(!isset($condition['backState']))
{
$condition['backState'] = -1;
}
?>
<div class="panel panel-default">
<div class="panel-body">
<form class="form-inline" method="get" >
<div>
<div class="form-group">
<label class="control-label">状态:</label>
<select id="select-search-state" data-placeholder="" class="width300 select2-offscreen" tabindex="-1" name="backState">
<option value="-1" <?php echo $condition['backState'] == -1? 'selected' :''?>>ALL</option>
<option value="0" <?php echo $condition['backState'] == 0 ? 'selected' :''?>>未上传回看视频</option>
<option value="1" <?php echo $condition['backState'] == 1 ? 'selected' :''?>>已上传回看视频</option>
</select>
</div>
<div class="form-group">
<label class="control-label">关键字:</label>
<input class="form-control" name="title" value="<?php echo isset($condition['title'])? $condition['title'] :''?>">
</div>
<button type="submit" class="btn btn-primary mr5">查询</button>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table mb30">
<thead>
<tr style="white-space:nowrap">
<th>视频ID</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($videoList as $video):?>
<tr>
<td><?php echo $video->id;?></td>
<td><?=ArrayHelper::getValue(Yii::$app->params['config']['app'], $video->app)?></td>
<td><?php echo $video->title;?></td>
<td><img src="<?php echo CommonImages::getImageUrl($video->pic, 100, 100)?>" /></td>
<td><?php echo $video->live_title;?></td>
<td><?php echo date('Y-m-d H:i:s', $video->live_start_time).' --- '.date('Y-m-d H:i:s', $video->live_end_time)?></td>
<td>
<?php foreach($masterList as $master) {
if($master->master_id == $video->master_id) echo $master->name;
}?>
</td>
<td><?php echo $video->room_id;?></td>
<td><?php echo $video->url;?></td>
<td style="white-space:nowrap">
<div class="form-group" videoId="<?php echo $video->id;?>">
<button class="btn btn-primary">编辑</button>
<button class="btn btn-warning btn-metro" status="<?php echo $video->status;?>"><?php echo $video->status? '关闭':'开启';?></button>
</div>
</td>
<td><?php echo date('Y-m-d H:i:s', $video->create_time)?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<!-- table-responsive -->
<?php echo LinkPager::widget(['pagination' => $pagination]);?>
</div>
<!-- col-md-12 -->
</div>
<link href="/css/select2.css" rel="stylesheet" postion="3">
<script src="/js/select2.min.js" postion="3"></script>
<script type="text/javascript">
$(function(){
$('#select-search-state').select2({
minimumResultsForSearch: -1
});
//设置状态
$(".btn-warning").bind("click", function()
{
var videoId = $(this).parent().attr("videoId");
var status = parseInt($(this).attr("status"));
var msg = '';
if(status) {
msg = '你确定要关闭?';
} else {
msg = "你确定要开启?";
}
status = status == 1 ? 0 :1;//转换
if(window.confirm(msg)) {
$.ajax
({
type:"post",
url:"/live/videosetstate",
data:{videoId:videoId, status:status},
dataType:"json",
success:function(data)
{
if(data.code == 200)
{
window.location.reload();
}
else
{
alert("设置失败");
}
}
});
}
});
//编辑
$(".btn-primary").bind("click", function()
{
var videoId = $(this).parent().attr("videoId");
window.location.href="/live/videoedit?id="+videoId;
});
});
</script>