代码:
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("删除成功!", '');
}
}