| xqd
@@ -114,10 +114,17 @@ class ProductController extends Controller
|
|
|
if ($request->method() == 'POST') {
|
|
|
return $this->_createSave();
|
|
|
}
|
|
|
- $cat = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id','!=',0]])->get();
|
|
|
-
|
|
|
+ $cat = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id', 0]])->get();
|
|
|
+ foreach ($cat as $key => $val) {
|
|
|
+ $son = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id', $val['id']]])->get();
|
|
|
+ $category[] = [
|
|
|
+ 'id' => 0,
|
|
|
+ 'name' => $val['name'],
|
|
|
+ 'son' => $son
|
|
|
+ ];
|
|
|
+ }
|
|
|
$data['cat_id'] = null;
|
|
|
- return view('admin.album.product.edit', compact('data', 'cat', 'style'));
|
|
|
+ return view('admin.album.product.edit', compact('data', 'category', 'style'));
|
|
|
}
|
|
|
|
|
|
/**
|