/** * 批量删除 */ public function batchDel() { $aid = Q('aid', '', ''); if (empty($aid)) { $this->error('请选择文章'); } $ContentModel = new Content(); foreach ($aid as $id) { $ContentModel->del($id); } $this->success('删除成功'); }
public function del() { $aids = Q("request.aid"); if (!empty($aids)) { if (!is_array($aids)) { $aids = array($aids); } $Model = new Content($this->mid); foreach ($aids as $aid) { $Model->del($aid); } $this->success('删除成功'); } else { $this->error('参数错误'); } }
public function del() { //验证权限 $this->checkAccess(); if ($aid = Q('aid', 0)) { $ContentModel = new Content(); if ($ContentModel->del($aid)) { $this->success('删除成功'); } else { $this->error($ContentModel->error); } } else { $this->error('参数错误'); } }
public function del() { $aid = Q('aid', 0); if ($aid) { $ContentModel = new Content($this->_mid); if ($ContentModel->del($aid)) { $this->success('删除成功'); } else { $this->error($ContentModel->error); } } else { $this->error('参数错误'); } }
/** * 删除文章 */ public function del() { $aid = Q('aid', 0, 'intval'); if (!$aid) { $this->error('文章不存在'); } $ContentModel = new Content($this->_mid); $result = $ContentModel->find($aid); if ($result['uid'] != $_SESSION['uid']) { $this->error('没有删除权限'); } if ($ContentModel->del($aid)) { $this->success('删除成功'); } else { $this->error('aid参数错误'); } }
public function del() { if (!$this->ContentAccess->isDel($this->_cid)) { $this->error('没有操作权限'); } $aid = Q('aid', 0); if ($aid) { $ContentModel = new Content($this->_mid); if ($ContentModel->del($aid)) { $this->success('删除成功'); } else { $this->error($ContentModel->error); } } else { $this->error('参数错误'); } }