dyjh 6 年之前
父節點
當前提交
0019b8bd56

+ 7 - 0
app/Http/Controllers/Admin/Album/PosterController.php

xqd xqd
@@ -36,6 +36,7 @@ class PosterController extends Controller
         if (!empty($data)) {
             $data = $data[0];
             $data['posters'] = json_decode($data['posters'], true);
+            $data['banners'] = json_decode($data['banners'], true);
             $data['words'] = json_decode($data['words'], true);
         }
         return view('admin.album.poster.edit', compact('data'));
@@ -53,6 +54,12 @@ class PosterController extends Controller
             }
             $data['posters'] = json_encode($data['posters']['url']);
         }
+        if (!empty($data['banners']['url'])) {
+            foreach ($data['banners']['url'] as $key => $val) {
+                $data['banners']['url'][$key] = $this->formatImgUrl($val);
+            }
+            $data['banners'] = json_encode($data['banners']['url']);
+        }
         if (empty($data['share']) || empty($data['qrcode'])) {
             return $this->showMessage('分享海报或者二维码不能为空!');
         }

+ 0 - 2
app/Http/Controllers/Api/V1/AlbumController.php

xqd
@@ -2156,8 +2156,6 @@ class AlbumController extends Controller
 
     public function albumGetBanner(Request $request)
     {
-        $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ],[

+ 1 - 0
app/Models/AlbumPosterModel.php

xqd
@@ -34,6 +34,7 @@ class AlbumPosterModel extends BaseModel
                            'store_id',
                            'posters',
                            'words',
+                           'banners',
                            'introduce',
                            'qrcode',
                            'title',

+ 33 - 0
database/migrations/2019_05_20_094445_add_column_banners_to_album_poster.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnBannersToAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_potser', function (Blueprint $table) {
+            //
+            $table->longText('banner')->nullable()->default('[]')->comment('九张图');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_potser', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 10 - 0
resources/views/admin/album/poster/edit.blade.php

xqd
@@ -38,6 +38,16 @@
                                     </div>
 
                                 </div>
+
+                                <div class="form-group">
+
+                                    <label class="control-label col-sm-3">保存(440*440)</label>
+                                    <div class="col-sm-9">
+                                        {!!  widget('Tools.ImgUpload')->multi2('/upload/banners','banners',"data[banners]", isset($data['banners'])? $data['banners'] : '',array("sizex"=>440,"sizey"=>440)) !!}
+                                    </div>
+
+                                </div>
+
                                 <div class="form-group">
 
                                  <label class="control-label col-sm-3">话术1</label>