mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-08 22:36:06 -06:00
return parent category list for create sub category
This commit is contained in:
parent
9977c01f49
commit
ade7012515
@ -39,6 +39,7 @@ class CategoryController extends AdminController
|
|||||||
if ($this->request->action == "save") {
|
if ($this->request->action == "save") {
|
||||||
$all = $this->request->all();
|
$all = $this->request->all();
|
||||||
$id = $all['parent_category'];
|
$id = $all['parent_category'];
|
||||||
|
$parent_id = $all['parent_category'];
|
||||||
$k = 1;
|
$k = 1;
|
||||||
for ($i = 0; $i < $k; $i++) {
|
for ($i = 0; $i < $k; $i++) {
|
||||||
$cat1 = CategoryModel::query()->where('cats_category.id', $id)->first();
|
$cat1 = CategoryModel::query()->where('cats_category.id', $id)->first();
|
||||||
@ -57,6 +58,11 @@ class CategoryController extends AdminController
|
|||||||
if ($form->hasFormErrors()) {
|
if ($form->hasFormErrors()) {
|
||||||
return $this->redirect->to('/admin/cats/create');
|
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');
|
return $this->redirect->to('/admin/cats');
|
||||||
} else {
|
} else {
|
||||||
$form->setFields(['name']);
|
$form->setFields(['name']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user