/** * 删除数据 * * @param $id * @throws \Exception * @author yangyifan <*****@*****.**> */ public function getDelete($id) { EmailModel::del($id) > 0 ? $this->response(200, trans('response.delete_success'), [], false, url('admin/news/index')) : $this->response(400, trans('response.delete_error'), [], false); }
/** * 处理新增菜单 * * @author yangyifan <*****@*****.**> */ public function postAdd(EmailRequest $request) { $affected_number = EmailModel::create($request->all()); return $affected_number->id > 0 ? $this->response(200, trans('response.add_success'), [], true, url('admin/email/index')) : $this->response(400, trans('response.add_error'), [], true, url('admin/email/index')); }