/** * 处理新增论坛分类 * * @author yangyifan <*****@*****.**> */ public function postAdd(ForumCatRequest $request) { $data = $request->all(); //删除值 unset($data['selectL']); unset($data['selectR']); //更新当前分类权限 $data['access'] = explode(',', trim($data['access'], ',')); ForumCatModel::updateCategoryAccess($data['access'], $data['id']); unset($data['access']); $affected_number = ForumCatModel::create($data); return $affected_number->id > 0 ? $this->response(200, trans('response.add_success'), [], true, url('admin/forum-cat/index')) : $this->response(400, trans('response.add_error'), [], true, url('admin/forum-cat/index')); }
/** * 处理新增论坛分类 * * @author yangyifan <*****@*****.**> */ public function postAdd(ForumCatRequest $request) { $affected_number = ForumCatModel::create($request->all()); return $affected_number->id > 0 ? $this->response(200, trans('response.add_success'), [], true, url('admin/forum-cat/index')) : $this->response(400, trans('response.add_error'), [], true, url('admin/forum-cat/index')); }