/**
  * 删除数据
  *
  * @param $id
  * @throws \Exception
  * @author yangyifan <*****@*****.**>
  */
 public function getDelete($id)
 {
     SearchCatModel::del($id) > 0 ? $this->response(200, trans('response.delete_success'), [], false, url('admin/news/index')) : $this->response(400, trans('response.delete_error'), [], false);
 }
Ejemplo n.º 2
0
 /**
  * 处理搜索工具分类
  *
  * @author yangyifan <*****@*****.**>
  */
 public function postAdd(SearchCatRequest $request)
 {
     $affected_number = SearchCatModel::create($request->all());
     return $affected_number->id > 0 ? $this->response(200, trans('response.add_success'), [], true, url('admin/search-cat/index')) : $this->response(400, trans('response.add_error'), [], true, url('admin/search-cat/index'));
 }
Ejemplo n.º 3
0
 /**
  * 增加搜索工具导航
  *
  * @author yangyifan <*****@*****.**>
  */
 public function getAdd()
 {
     return $this->html_builder->builderTitle('增加搜索工具导航')->builderFormSchema('name', '搜索工具导航名称', $type = 'text', $default = '', $notice = '', $class = '', $rule = '*', $err_message = '', $option = '', $option_value_schema = '')->builderFormSchema('search_cat_id', '所属分类', 'select', $default = '', $notice = '', $class = '', $rule = '*', $err_message = '', SearchCatModel::getAllForSchemaOption('cat_name'), 'cat_name')->builderFormSchema('search_url', 'url')->builderFormSchema('sort', '排序', 'text', 255)->builderFormSchema('status', '状态', 'radio', '', '', '', '', '', [1 => '开启', '2' => '关闭'], '1')->builderConfirmBotton('确认', url('admin/search/add'), 'btn btn-success')->builderAdd();
 }