Merge pull request #114 from openclassify/vedat

return parent category list for create sub category
This commit is contained in:
Fatih Alp 2019-10-21 10:30:47 +03:00 committed by GitHub
commit 364a1369ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,7 @@ class CategoryController extends AdminController
if ($this->request->action == "save") {
$all = $this->request->all();
$id = $all['parent_category'];
$parent_id = $all['parent_category'];
$k = 1;
for ($i = 0; $i < $k; $i++) {
$cat1 = CategoryModel::query()->where('cats_category.id', $id)->first();
@ -57,6 +58,11 @@ class CategoryController extends AdminController
if ($form->hasFormErrors()) {
return $this->redirect->to('/admin/cats/create');
}
if($parent_id != "")
{
return $this->redirect->to('/admin/cats?cat='.$parent_id);
}
return $this->redirect->to('/admin/cats');
} else {
$form->setFields(['name']);