gq 6 years ago
parent
commit
93cbc8475d

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

xqd
@@ -239,7 +239,8 @@ class AlbumController extends Controller
             $token = $userAuth->createToken($userAuth->id . '-' . $userAuth->openid)->accessToken;
             $conf = AlbumManufacturerModel::where('store_id',$datas['store_id'])->first();
             $getPhone = $conf->getPhone;
-            return $this->api(compact('token', 'user','getPhone'));
+            $getFocus = $conf->getFocus;
+            return $this->api(compact('token', 'user','getPhone','getFocus'));
         } else {
             return $this->error(ErrorCode::INCORRECT_USER_OR_PASS);
         }

+ 2 - 1
app/Models/AlbumManufacturerModel.php

xqd
@@ -59,7 +59,8 @@ class AlbumManufacturerModel extends BaseModel
         'print_key',
         'redirectapp',
         'print_type',
-        'getPhone'
+        'getPhone',
+        'getFocus'
     ];
 
 }

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

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnToAlbumManufacturerGetFocus extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+            $table->unsignedInteger('getFocus')->default(0)->nullable()->comment('是否开启关注公众号');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 16 - 0
resources/views/admin/album/manufacturer/edit.blade.php

xqd
@@ -146,6 +146,22 @@
                                             </label>
                                         </div>
 
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">是否开启关注公众号</label>
+
+                                        <div class="col-sm-9">
+                                            <label class="radio-inline">
+                                                <input type="radio" name="data[getFocus]" value="1"
+                                                       @if(isset($data['getFocus']) && $data['getFocus'] == '1')checked="checked" @endif/>是
+                                            </label>
+                                            <label class="radio-inline">
+                                                <input type="radio" name="data[getFocus]" value="0"
+                                                       @if(isset($data['getFocus']) && $data['getFocus'] == '0')checked="checked" @endif/>否
+                                            </label>
+                                        </div>
+
                                     </div>
                                         <div class="form-group">