del.lt 374 B

123456789101112
  1. //删除
  2. public function del(){
  3. $ids = array_filter($this->request->post('ids'));
  4. if (!$ids) {
  5. return $this->error('参数ids不能为空');
  6. }
  7. if ($this->model->destroy($ids)) {
  8. return $this->success('数据删除成功');
  9. } else {
  10. return $this->error('数据删除失败');
  11. }
  12. }