Commit 97815b63 authored by hujun's avatar hujun

商铺视频列表

parent efae3c62
...@@ -22,6 +22,7 @@ use app\model\GHousesExt; ...@@ -22,6 +22,7 @@ use app\model\GHousesExt;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
use app\model\GHousesImgs; use app\model\GHousesImgs;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\GHousesVideo;
use app\model\GLandlordPhone; use app\model\GLandlordPhone;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
use app\model\SubletModel; use app\model\SubletModel;
...@@ -845,4 +846,49 @@ class Houses extends Basic ...@@ -845,4 +846,49 @@ class Houses extends Basic
return $this->response($code, $msg, []); 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['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';
$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_id'] = $v['check_id'] ? 1 : 0;
}
$path = 'resource/lib/Attachments/video/';
return $this->response(200, '', ['list'=>$data, 'total'=>$total, 'path'=>$path]);
}
} }
\ No newline at end of file
...@@ -90,4 +90,38 @@ class GHousesVideo extends BaseModel ...@@ -90,4 +90,38 @@ class GHousesVideo extends BaseModel
return $result; return $result;
} }
/**
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getVideoAgentList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)->alias('a')
->join('a_agents b', 'a.upload_id = b.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/**
* @param string $params
* @param string $field
* @return int|string
*/
public function getVideoAgentListTotal($params = '', $field = 'a.id') {
return $this->field($field)->alias('a')
->join('a_agents b', 'a.upload_id = b.id', 'left')
->where($params)
->count();
}
} }
\ No newline at end of file
...@@ -125,6 +125,7 @@ Route::group('index', [ ...@@ -125,6 +125,7 @@ Route::group('index', [
'getEditLog' => ['index/houses/getEditLog', ['method' => 'get']],//商铺修改日志 'getEditLog' => ['index/houses/getEditLog', ['method' => 'get']],//商铺修改日志
'isShow' => ['index/houses/isShow', ['method' => 'POST']],//是否对C端显示 'isShow' => ['index/houses/isShow', ['method' => 'POST']],//是否对C端显示
'vipHouse' => ['index/houses/vipHouse', ['method' => 'POST']],//vip盘 'vipHouse' => ['index/houses/vipHouse', ['method' => 'POST']],//vip盘
'houseVideoList' => ['index/houses/houseVideoList', ['method' => 'GET']],//视频审核列表
//版本管理 //版本管理
'version' => ['index/version/index', ['method' => 'get']], '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