Commit 9116d362 authored by hujun's avatar hujun

视频删除和审核

parent 89e4647c
......@@ -878,7 +878,7 @@ class Houses extends Basic
}
}
$m_house_video = new GHousesVideo();
$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';
......@@ -886,9 +886,46 @@ class Houses extends Basic
$total = $m_house_video->getVideoAgentListTotal($where);
foreach ($data as $k=>$v) {
$data[$k]['check_time'] = $v['check_time'] ? $v['check_time'] : '';
$data[$k]['check_id'] = $v['check_id'] ? 1 : 0;
$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;
} 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
......@@ -126,6 +126,8 @@ Route::group('index', [
'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']],//视频删除
//版本管理
'version' => ['index/version/index', ['method' => 'get']],
......
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