Commit 158bcbb3 authored by hujun's avatar hujun

视频审核和删除

parent 21e89343
......@@ -846,91 +846,4 @@ class Houses extends Basic
return $this->response($code, $msg, []);
}
/**
* 商铺视频列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function houseVideoList()
{
$where['is_del'] = 0;
if (isset($this->params['district_id'])) {
$where['b.district_id'] = $this->params['district_id'];
}
if (isset($this->params['store_id'])) {
$where['b.store_id'] = $this->params['store_id'];
}
if (isset($this->params['house_id'])) {
$where['a.house_id'] = $this->params['house_id'];
}
if (isset($this->params['agent_id'])) {
$where['a.upload_id'] = $this->params['agent_id'];
}
if (isset($this->params['is_check']) && $this->params['is_check'] == 0) {
if ($this->params['is_check'] != 1) {
$where['agent_id'] = 0;
} else {
$where['agent_id'] = ['>', 0];
}
}
$m_house_video = new GHousesVideo();
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$field = 'a.id,a.video_name,a.house_id,a.upload_name,a.check_name,a.check_id,a.check_time,a.create_time,a.video_image';
$data = $m_house_video->getVideoAgentList($pageNo, $pageSize, 'a.id desc', $field, $where);
$total = $m_house_video->getVideoAgentListTotal($where);
foreach ($data as $k=>$v) {
$data[$k]['check_time'] = $v['check_time'] ? $v['check_time'] : '';
$data[$k]['check_status'] = $v['check_id'] ? 1 : 0;
}
$path = 'resource/lib/Attachments/video/';
return $this->response(200, '', ['list'=>$data, 'total'=>$total, 'path'=>$path]);
}
/**
* 删除和审核视频
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function checkVideo()
{
$code = 101;
if (empty($this->params['video_id']) || empty($this->params['type'])) {
return $this->response($code, '参数错误');
}
$m_house_video = new GHousesVideo();
$num = $m_house_video->getTotal(['id'=>$this->params['video_id'], 'is_del'=>0]);
if (!$num) {
return $this->response($code, '没有该视频');
}
if ($this->params['type'] == 'check') {
$data['check_id'] = $this->userId;
$data['check_name'] = $this->userName;
$data['check_time'] = date('Y-m-d H:i:s');
} else {
$data['is_del'] = 1;
}
$num = $m_house_video->updateData($data, ['id'=>$this->params['video_id']]);
if ($num) {
$msg = '审核成功';
$code = 200;
} else {
$msg = '审核失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -24,26 +24,83 @@ class VideoCheck extends Basic
public function videoCheckList()
{
$this->display("video_check_list");
if (!$this->request->isAjax()) {
return view('video_check/video_check_list');
}
$where['is_del'] = 0;
if (isset($this->params['district_id'])) {
$where['b.district_id'] = $this->params['district_id'];
}
if (isset($this->params['store_id'])) {
$where['b.store_id'] = $this->params['store_id'];
}
if (isset($this->params['house_id'])) {
$where['a.house_id'] = $this->params['house_id'];
}
if (isset($this->params['agent_id'])) {
$where['a.upload_id'] = $this->params['agent_id'];
}
if (isset($this->params['is_check']) && $this->params['is_check'] != 0) {
if ($this->params['is_check'] == 1) {
$where['a.check_id'] = 0;
} else {
$where['a.check_id'] = ['>', 0];
}
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$field = 'a.id,a.video_name,a.house_id,a.upload_name,a.check_name,a.check_id,a.check_time,a.create_time,a.video_image';
$data = $this->m_houses_video->getVideoAgentList($pageNo, $pageSize, 'a.id desc', $field, $where);
$total = $this->m_houses_video->getVideoAgentListTotal($where);
foreach ($data as $k=>$v) {
$data[$k]['check_time'] = $v['check_time'] ? $v['check_time'] : '';
}
$path = 'resource/lib/Attachments/video/';
return $this->response(200, '', ['list'=>$data, 'total'=>$total, 'path'=>$path]);
}
public function getHouseVideoList()
/**
* 删除和审核视频
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function checkVideo()
{
$params = $this->params;
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$code = 101;
if (empty($this->params['video_id']) || empty($this->params['type'])) {
return $this->response($code, '参数错误');
}
$res = $this->m_houses_video->getHouseVideoList($pageNo, $pageSize, $field, $get_params);
$res_total = $this->m_houses_video->getHouseVideoListTotal($field, $get_params);
$num = $this->m_houses_video->getTotal(['id'=>$this->params['video_id'], 'is_del'=>0]);
if (!$num) {
return $this->response($code, '没有该视频');
}
foreach ($res as $key => $val) {
if ($this->params['type'] == 'check') {
$data['check_id'] = $this->userId;
$data['check_name'] = $this->userName;
$data['check_time'] = date('Y-m-d H:i:s');
$msg = '审核成功';
} else {
$data['is_del'] = 1;
$msg = '删除成功';
}
$num = $this->m_houses_video->updateData($data, ['id'=>$this->params['video_id']]);
if ($num) {
$code = 200;
} else {
$msg = '操作失败';
}
return $this->response($code, $msg);
}
}
......
{layout name="global/frame_two_tpl" /}
video_check_list{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="videoCheckList" />
<style>
video{
......
......@@ -125,9 +125,9 @@ Route::group('index', [
'getEditLog' => ['index/houses/getEditLog', ['method' => 'get']],//商铺修改日志
'isShow' => ['index/houses/isShow', ['method' => 'POST']],//是否对C端显示
'vipHouse' => ['index/houses/vipHouse', ['method' => 'POST']],//vip盘
'houseVideoList' => ['index/houses/houseVideoList', ['method' => 'GET']],//视频审核列表
'checkVideo' => ['index/houses/checkVideo', ['method' => 'POST']],//视频审核
'delVideo' => ['index/houses/checkVideo', ['method' => 'POST']],//视频删除
'videoCheckList' => ['index/VideoCheck/videoCheckList', ['method' => 'GET']],//视频审核列表
'checkVideo' => ['index/VideoCheck/checkVideo', ['method' => 'POST']],//视频审核
'delVideo' => ['index/VideoCheck/checkVideo', ['method' => 'POST']],//视频删除
//版本管理
'version' => ['index/version/index', ['method' => 'get']],
......
......@@ -103,7 +103,7 @@ define(['doT', 'text!temp/video_check_list_template_tpl.html', 'css!style/home.c
$('.shop-name').html(house.videoName);
$('.shop-time').html(house.videoTime);
document.getElementById("video-check").src = ServerHostImageLiu + '/resource/lib/Attachments/video/' + house.videoPath;
if($(this).attr("data-status") == 1){//审核过
if($(this).attr("data-check_id") > 0){//审核过
$('.shop-name-check').html('');
$('.shop-time-check').html('');
$('.checkVideo').hide();
......@@ -112,11 +112,14 @@ define(['doT', 'text!temp/video_check_list_template_tpl.html', 'css!style/home.c
$('.shop-time-check').hide();
$('.checkVideo').show();
}
});
//审核视频 删除视频
_doc.on('click', '.delVideo', function(){
if (!confirm('是否删除?')) {
return ;
}
var _this = $(this);
house.videoId = _this.attr("data-id");
house.delVideo();
});
//审核视频 审核通过视频
......@@ -168,23 +171,34 @@ define(['doT', 'text!temp/video_check_list_template_tpl.html', 'css!style/home.c
house.getFollowupList();
// $('.iframe-shop-detail').attr('src', '/app_broker/shop_detail_pc?shop_id='+_id);
});
},
getList: function(pageNo) { //商铺视频列表
house.pageNo = pageNo;
var params = {};
params.pageNo = house.pageNo;
params.pageSize = house.pageSize;
params.district_id = $('#district_id').val();//部门
params.store_id = $('#guest_stores').val();//门店
params.agent_id = house.agent_id_phone?house.agent_id_phone:$('#guest_stores_agent').val(); //下拉搜索 跟进人id
params.is_check = $('#is_check').val();
params.shop_id = $('#shop_id').val();
params.is_check = $('#is_check').val();
var district_id = $('#district_id').val();//部门
if (district_id) {
params.district_id = district_id;
}
var store_id = $('#guest_stores').val();//门店
if (store_id) {
params.store_id = store_id;//门店
}
var agent_id = house.agent_id_phone?house.agent_id_phone:$('#guest_stores_agent').val(); //下拉搜索 跟进人id
if (agent_id) {
params.agent_id = agent_id;
}
var house_id = $('#shop_id').val();
if (house_id) {
params.house_id = house_id;
}
$.ajax({
type: 'GET',
url: '/index/houseVideoList', //商铺视频审核
url: '/index/videoCheckList', //商铺视频审核
data: params,
timeout: 30000,
dataType: 'json',
......@@ -197,7 +211,7 @@ define(['doT', 'text!temp/video_check_list_template_tpl.html', 'css!style/home.c
var doTtmpl = doT.template(document.getElementById('video_check_list_tpl').innerHTML);
$("#shop_video_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(40000, pageNo, house.pageSize, house.getList);
add_page(data.data.total, pageNo, house.pageSize, house.getList);
$('.hide-total-info-liu').hide();
} else {
......@@ -267,9 +281,13 @@ define(['doT', 'text!temp/video_check_list_template_tpl.html', 'css!style/home.c
},
dataType: 'json',
success: function(data) {
alert(data.msg);
$("#modal_shop_check").modal('hide');
if (data.code == 200) {
house.getList(house.pageNo);
alert(data.msg);
$("#modal_shop_check").modal('hide');
} else {
alert(data.msg);
}
}
});
},
......@@ -284,9 +302,13 @@ define(['doT', 'text!temp/video_check_list_template_tpl.html', 'css!style/home.c
},
dataType: 'json',
success: function(data) {
alert(data.msg);
$("#modal_shop_check").modal('hide');
if (data.code == 200) {
house.getList(house.pageNo);
alert(data.msg);
$("#modal_shop_check").modal('hide');
} else {
alert(data.msg)
}
}
});
},
......
......@@ -6,18 +6,21 @@
<td>[%= it[item]['upload_name'] %]</td>
<td>[%= it[item]['house_id'] %]</td>
<td>
[% if(it[item]["check_status"] == 1) { %]
[% if(it[item]["check_id"] > 0 ) { %]
已审核
[% } else{ %]
未审核
未审核
[% } %]
</td>
<td>
<a class="btn1 btn-success review-video" href="#modal_shop_check" data-name='[%= it[item]["video_name"] %]' data-toggle="modal" data-uploadName='[%= it[item]["upload_name"] %]' data-time='[%= it[item]["create_time"] %]' data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["check_status"] %]'>审核</a>
<a class="btn1 btn-success" href="#modal_shop_detail" data-id='[%= it[item]["house_id"] %]' data-toggle="modal">查看商铺</a>
[% if(it[item]["check_id"] == 0 && check_auth('index/checkVideo')) { %]
<a class="btn1 btn-success review-video" href="#modal_shop_check" data-name='[%= it[item]["video_name"] %]' data-toggle="modal" data-uploadName='[%= it[item]["upload_name"] %]' data-time='[%= it[item]["create_time"] %]' data-id='[%= it[item]["id"] %]' data-check_id='[%= it[item]["check_id"] %]'>审核</a>
[% } %]
<a class="btn1 btn-success" href="#modal_shop_detail" data-id='[%= it[item]["house_id"] %]' data-toggle="modal">查看商铺</a>
[% if(check_auth('index/delVideo')) { %]
<a class="btn1 btn-danger delVideo" href="javascript:;" data-id='[%= it[item]["id"] %]'>删除</a>
[% } %]
</td>
</tr>
[% } %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment