thinkcmf 批量删除

2018-06-25  本文已影响0人  cuihaomaster

代码:

public function delete()
    {
        $param           = $this->request->param();
        if (isset($param['id'])) {
            $id           = $this->request->param('id', 0, 'intval');
            $res       = Db::table('cmf_contact')->delete($id);
            $this->success("删除成功!", '');

        }
        if (isset($param['ids'])) {
            $ids     = $this->request->param('ids/a');
            $res = Db::table('cmf_contact')->where(['id' => ['in', $ids]])->delete();

            $this->success("删除成功!", '');
        }
    }
上一篇下一篇

猜你喜欢

热点阅读