|
@@ -73,12 +73,20 @@ class Ad extends Backend
|
|
|
|
|
|
public function edit($ids = null)
|
|
|
{
|
|
|
+ $this->check($ids);
|
|
|
+ return parent::edit($ids);
|
|
|
+ }
|
|
|
+ protected function check($ids){
|
|
|
if($this->admin('is_sub')){
|
|
|
$check=$this->model->where('id',$ids)->where('admin_id',$this->auth->id)->find();
|
|
|
if(!$check){
|
|
|
$this->error('无权操作');
|
|
|
}
|
|
|
}
|
|
|
- return parent::edit($ids);
|
|
|
+ }
|
|
|
+ public function del($ids = "")
|
|
|
+ {
|
|
|
+ $this->check($ids);
|
|
|
+ parent::del($ids);
|
|
|
}
|
|
|
}
|