123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- * Created by Sublime.
- * User: Williamslife Wang
- * Date: 17/10/18
- * Time: 上午11:20
- */
- namespace App\Http\Controllers\Admin;
- use App\Http\Controllers\Controller;
- use App\Role;
- use App\AdminRole;
- // use App\ProductChannel;
- // use App\Logs;
- use Illuminate\Support\Facades\DB;
- class IndexController extends Controller
- {
- public function index()
- {
- $name = session("username");
- $admin_id = session("admin_id");
- $role = AdminRole::where('user_id', '=', $admin_id)->get();
- $res = [];
- foreach($role as $v){
- $roles = Role::where('name', '=', $v['role_name'])->get();
- foreach($roles as $vv){
- $res[$vv['child']] = $vv['child'];
- }
- }
- $res = array_unique($res);
- return view('admin/index',['res'=>$res]);
- }
- }
|