| xqd
@@ -179,12 +179,20 @@ class ProductController extends Controller
|
|
|
if ($request->method() == 'POST') {
|
|
|
return $this->_updateSave();
|
|
|
}
|
|
|
- $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 = $this->repository->find($request->get('id'));
|
|
|
$data['install_img'] = json_decode($data['install_img']);
|
|
|
$data['specifications_img'] = json_decode($data['specifications_img']);
|
|
|
$data['detail'] = json_decode($data['detail']);
|
|
|
- return view('admin.album.product.edit', compact('data', 'cat', 'parent'));
|
|
|
+ return view('admin.album.product.edit', compact('data', 'category', 'parent'));
|
|
|
}
|
|
|
|
|
|
/**
|