dyjh 6 anni fa
parent
commit
7c53d66f87

+ 8 - 8
app/Http/Controllers/Admin/Album/ManufacturerController.php

xqd
@@ -38,27 +38,27 @@ class ManufacturerController extends Controller
     }
 
     function index(Request $request) {
-        if($request->method() == 'POST') {
-            $iscreate = AlbumManufacturerModel::where('store_id',$this->getStoreId())->first();
-            if($iscreate){
+        if ($request->method() == 'POST') {
+            $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+            if ($iscreate) {
                 return $this->_updateSave();
-            }else{
+            } else {
                 return $this->_createSave();
             }
 
         }
-        $data = AlbumManufacturerModel::where('store_id',$this->getStoreId())->first();
+        $data = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
         if ($data) {
             $data['banner'] = json_decode($data['banner'], true);
         }
         $banner = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',0]])->get();
         $imgs = array();
-        foreach($banner as $key=>$val){
+        foreach ($banner as $key => $val) {
             $imgs[] = $val['url'];
         }
         $data->agent_banner = $imgs;
-        $video = AgentBannerModel::where([['agent_id',$request->get('id')],['type',1]])->first();
-        return view('admin.album.manufacturer.edit',compact('data'));
+        $video = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',1]])->first();
+        return view('admin.album.manufacturer.edit', compact('data', 'video'));
     }
 
     function create(Request $request)