dyjh 6 yıl önce
ebeveyn
işleme
b88308e70f

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

xqd
@@ -53,6 +53,9 @@ class PosterController extends Controller
             }
             $data['posters'] = json_encode($data['posters']['url']);
         }
+        if (empty($data['share']) || empty($data['qrcode'])) {
+            return $this->showMessage('分享海报或者二维码不能为空!');
+        }
         $data['share'] = $this->formatImgUrl($data['share']);
         $data['qrcode'] = $this->formatImgUrl($data['qrcode']);
         if (!empty($data['words'])) {

+ 3 - 2
app/Services/Base/Attachment.php

xqd xqd
@@ -12,12 +12,13 @@
 
 namespace App\Services\Base;
 
+use App\Http\Controllers\Admin\Controller;
 use App\Models\BaseAttachmentModel;
 use Grafika\Grafika;
 use Response;
 use App\Models\BaseSettingsModel;
 use Image;
-class Attachment
+class Attachment extends Controller
 {
     private $_model;
 
@@ -232,7 +233,7 @@ class Attachment
             $attachment->path = $real_path;
             $attachment->url = $url_path;
             $attachment->size = $fileSize;
-
+            $attachment->store_id = $this->getStoreId();
             $attachment->file_type = $fileMimeType;
             $attachment->class = $class;
             if ($attachment->save()) {

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

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddStoreIdToBaseAttachment extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('base_attachment', function (Blueprint $table) {
+            //
+            $table->unsignedInteger('store_id')->nullable()->default(0);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('base_attachment', function (Blueprint $table) {
+            //
+        });
+    }
+}