dyjh 6 years ago
parent
commit
475e785769
1 changed files with 6 additions and 4 deletions
  1. 6 4
      app/Http/Controllers/Admin/Album/ManufacturerController.php

+ 6 - 4
app/Http/Controllers/Admin/Album/ManufacturerController.php

xqd xqd xqd
@@ -57,7 +57,7 @@ class ManufacturerController extends Controller
         foreach ($banner as $key => $val) {
             $imgs[] = $val['url'];
         }
-        $data->agent_banner = $imgs;
+        $data['agent_banner'] = $imgs;
         $video = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',1]])->first();
         return view('admin.album.manufacturer.edit', compact('data', 'video'));
     }
@@ -94,7 +94,9 @@ class ManufacturerController extends Controller
      */
     private function _createSave(){
         $data = (array) request('data');
-        $data['store_id'] =$this->getStoreId();
+        $ma = AlbumManufacturerModel::where('id','!=',0)->orderByDesc('id')->first();
+
+        $data['store_id'] =$ma->id+1;
         if (!empty($data['banner']['url'])) {
             foreach ($data['banner']['url'] as $key => $val) {
                 $data['banner']['url'][$key] = $this->formatImgUrl($val);
@@ -131,9 +133,9 @@ class ManufacturerController extends Controller
             $data['furniture_ads_pic'] = $this->formatImgUrl($data['furniture_ads_pic']);
 
         $id = $this->repository->create($data);
-        if($id) {
+        if ($id) {
             $this->showMessage('添加成功');
-        }else{
+        } else {
             return $this->showWarning('添加失败');
         }
     }