dyjh 6 年之前
父節點
當前提交
06006b7659

+ 0 - 1
app/Http/Controllers/Admin/Base/UserController.php

xqd
@@ -59,7 +59,6 @@ class UserController extends Controller
 
         }
         $roles = pairList($this->_getRoles(), 'id', 'name');
-        dd($list);
         return view('admin.base.user.index', compact('list', 'roles'));
     }
 

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

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

+ 12 - 0
resources/views/admin/base/role/edit.blade.php

xqd
@@ -57,6 +57,18 @@
                                         </label>
                                     </div>
                                 </div>
+
+                                <div class="form-group">
+                                    <label class="control-label col-sm-3">非root用户是否可见</label>
+                                    <div class="col-sm-9">
+                                        <label class="radio-inline">
+                                            <input type="radio" name="info[is_root]" value="0" <?php if(isset($data['is_root']) && $data['is_root'] == 0){ echo ' checked="checked"'; } ?>>是
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="info[is_root]" value="1" <?php if(isset($data['is_root']) && $data['is_root'] == 1){ echo ' checked="checked"'; } ?>>否
+                                        </label>
+                                    </div>
+                                </div>
  
                                 <div class="form-group">
                                     <label class="control-label col-sm-3">&nbsp;</label>