Commit 13513aa8 authored by hujun's avatar hujun

上传视频判断

parent a4bcaf22
......@@ -706,6 +706,13 @@ class Shop extends Basic
if ($upload_video_num < 3) {
$result['is_upload_video'] = 1;
}
if (!$result['is_upload_video']) {
$upload_video_num = $s_house->getHouseVideoNum($params['id'], 0, $this->agentId);
if ($upload_video_num) {
$result['is_upload_video'] = 1;
}
}
unset($result['external_image_id']);
return $this->response("200", 'request success', $result);
}
......
......@@ -1079,11 +1079,13 @@ class HouseService
/**
* 商铺视频数量
*
*
* @param $house_id
* @param int $is_check
* @param int $agent_id
* @return int|string
*/
public function getHouseVideoNum($house_id, $is_check = 0) {
public function getHouseVideoNum($house_id, $is_check = 0, $agent_id = 0) {
$m_video = new GHousesVideo();
$where['is_del'] = 0;
$where['house_id'] = $house_id;
......@@ -1093,6 +1095,10 @@ class HouseService
case 2 :
$where['check_id'] = ['>', 0];break; //已审核
}
if ($agent_id) {
$where['upload_id'] = $agent_id;
}
$num = $m_video->getTotal($where);
return $num;
}
......
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