Commit 11cec534 authored by hujun's avatar hujun

视频列表

parent 91c9fc02
......@@ -17,6 +17,7 @@ use app\model\GHousesExt;
use app\model\GHousesFollowUp;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GHousesVideo;
use app\model\GImageDepot;
use app\model\GLandlordPhone;
use app\model\OBargainModel;
......@@ -1114,4 +1115,85 @@ class Shop 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()
{
if (isset($this->params['is_check']) && $this->params['is_check'] == 0) {
if ($this->params['is_check'] != 1) {
$where['check_id'] = 0;
} else {
$where['check_id'] = ['>', 0];
}
}
$where['is_del'] = 0;
$vip = new VipService();
$is_auth = $vip->checkRule($this->agentId, 'index/checkVideo');
if ($is_auth) {
$where['a.upload_id'] = $this->agentId;
} else {
$m_agent = new AAgents();
$agent_data = $m_agent->getAgentInfo('district_id,store_id', $this->agentId);
$where['b.district_id'] = $agent_data['district_id'];
$where['b.store_id'] = $agent_data['store_id'];
}
$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);
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, 'path'=>$path,'is_auth'=>$is_auth]);
}
/**
* 删除和审核视频
*
* @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->agentId;
$data['check_name'] = $this->agentName;
$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);
}
}
......@@ -673,7 +673,8 @@ Route::group('broker', [
'getShopDetail' => ['api_broker/Shop/getShopDetail', ['method' => 'get']],
'addShopFollowUp' => ['api_broker/Shop/addShopFollowUp', ['method' => 'post']], //新增商铺跟进记录
'addHouseVideo' => ['api_broker/Shop/addHouseVideo', ['method' => 'post']], //新增商铺视频
'houseVideoList' => ['api_broker/Shop/houseVideoList', ['method' => 'get']], //商铺视频列表
'checkVideo' => ['api_broker/Shop/checkVideo', ['method' => 'post']], //视频审核和删除
'reportList' => [ 'api_broker/Report/reportList', [ 'method' => 'get' ] ],
'getCheckType' => [ 'api_broker/Report/getCheckType', [ 'method' => 'get|post' ] ],
......
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