| xqd
@@ -67,6 +67,10 @@ class ProductController extends Controller
|
|
|
return view('admin.album.product.check', compact('list'));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param Request $request
|
|
|
+ * @return \Illuminate\Http\JsonResponse
|
|
|
+ */
|
|
|
public function getSecondCategory(Request $request)
|
|
|
{
|
|
|
$cat_id = $request->input('cat_id');
|
| xqd
@@ -95,13 +99,13 @@ class ProductController extends Controller
|
|
|
*/
|
|
|
public function create(Request $request)
|
|
|
{
|
|
|
- if($request->method() == 'POST') {
|
|
|
+ if ($request->method() == 'POST') {
|
|
|
return $this->_createSave();
|
|
|
}
|
|
|
$cat = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id',0]])->get();
|
|
|
- $style = AlbumProductStyleModel::Where('store_id',$this->getStoreId())->get();
|
|
|
- $data['cat_id']=null;
|
|
|
- return view('admin.album.product.edit',compact('data','cat','style'));
|
|
|
+
|
|
|
+ $data['cat_id'] = null;
|
|
|
+ return view('admin.album.product.edit', compact('data', 'cat', 'style'));
|
|
|
}
|
|
|
|
|
|
/**
|
| xqd
@@ -151,21 +155,18 @@ class ProductController extends Controller
|
|
|
*
|
|
|
*
|
|
|
*/
|
|
|
- public function update(Request $request) {
|
|
|
- if($request->method() == 'POST') {
|
|
|
+ public function update(Request $request)
|
|
|
+ {
|
|
|
+ if ($request->method() == 'POST') {
|
|
|
return $this->_updateSave();
|
|
|
}
|
|
|
$cat = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id',0]])->get();
|
|
|
- $style = AlbumProductStyleModel::Where('store_id',$this->getStoreId())->get();
|
|
|
$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','style'));
|
|
|
+ $parent = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id',0],['id',$data->cat_id]])->get();
|
|
|
+ $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'));
|
|
|
}
|
|
|
|
|
|
/**
|