Commit 4ba8b958 authored by hujun's avatar hujun

删除视频修改

parent d934dc84
......@@ -1192,33 +1192,39 @@ class Shop extends Basic
}
$m_house_video = new GHousesVideo();
$num = $m_house_video->getTotal(['id'=>$this->params['video_id'], 'is_del'=>0]);
if (!$num) {
$video_data = $m_house_video->getVideoFind('id,upload_id',['id'=>$this->params['video_id'], 'is_del'=>0]);
if (!$video_data['id']) {
return $this->response($code, '没有该视频');
}
$is_auth = 0;
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');
$rule_name = 'index/checkVideo';
$vip = new VipService();
$is_auth = $vip->checkRule($this->agentId, $rule_name);
} else {
$data['is_del'] = 1;
$rule_name = 'index/delVideo';
if ($video_data['upload_id'] != $this->agentId) {
$rule_name = 'index/delVideo';
$vip = new VipService();
$is_auth = $vip->checkRule($this->agentId, $rule_name);
}
}
$vip = new VipService();
$is_auth = $vip->checkRule($this->agentId, $rule_name);
if ($is_auth) {
return $this->response(101, '没有权限');
}
$num = $m_house_video->updateData($data, ['id'=>$this->params['video_id']]);
if ($num) {
$msg = '审核成功';
$msg = $this->params['type'] == 'check' ? '审核成功' : '删除成功';
$code = 200;
} else {
$msg = '审核失败';
$msg = $this->params['type'] == 'check' ? '审核失败':'删除失败';
}
return $this->response($code, $msg);
}
......
......@@ -59,6 +59,19 @@ class GHousesVideo extends BaseModel
return $this->db_->where($where)->column($field);
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getVideoFind($field, $where)
{
return $this->db_->field($field)->where($where)->find();
}
/**
* @param $pageNo
* @param $pageSize
......
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