|
|
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Http\Request\EditAdminAuth;
|
|
|
|
|
use App\Models\AdminAuth;
|
|
|
|
|
use App\Models\AdminAuthGroup;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Login;
|
|
|
|
|
use Yo;
|
|
|
|
|
@ -92,9 +93,15 @@ class AdminAuthController extends Controller
|
|
|
|
|
$data['list'] = $auth_group_list;
|
|
|
|
|
$list[] = $data;
|
|
|
|
|
}
|
|
|
|
|
$auth_group_single = AdminAuth::where('pid', 0)->where('type', 2)->where('del', 2)->orderBy('order', 'desc')->get()->toArray();
|
|
|
|
|
$auth_group_single = AdminAuth::where('pid', 0)->where('type', 2)->where('del', 2)->orderBy('order', 'desc')->get();
|
|
|
|
|
foreach ($auth_group_single as $item) {
|
|
|
|
|
$list[] = [
|
|
|
|
|
'info' => $item,
|
|
|
|
|
'list' => []
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
return Yo::echo([
|
|
|
|
|
'list' => array_merge($list, $auth_group_single)
|
|
|
|
|
'list' => $list
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -166,14 +173,14 @@ class AdminAuthController extends Controller
|
|
|
|
|
->orderBy('order', 'desc')->get();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$admin_auth = AdminAuth::find(Login::$info->admin_auth_group);
|
|
|
|
|
$auths = json_decode($admin_auth->auths, true);
|
|
|
|
|
$admin_auth_group = AdminAuthGroup::find(Login::$info->admin_auth_group);
|
|
|
|
|
$auths = json_decode($admin_auth_group->admin_auths, true);
|
|
|
|
|
$auth_list = AdminAuth::select('id', 'name', 'title', 'icon', 'status')
|
|
|
|
|
->where(function ($query) use ($auths, $item) {
|
|
|
|
|
$query->whereIn('id', $auths)->where('pid', $item->id)->where('type', 2)->where('check_type', 2)->where('show', 1)->where('status', 1)->where('del', 2);
|
|
|
|
|
$query->whereIn('id', $auths)->where('pid', $item->id)->where('type', 2)->where('check', 1)->where('show', 1)->where('status', 1)->where('del', 2);
|
|
|
|
|
})
|
|
|
|
|
->orWhere(function ($query) use ($auths, $item) {
|
|
|
|
|
$query->where('type', 2)->where('pid', $item->id)->where('check_type', 1)->where('show', 1)->where('status', 1)->where('del', 2);
|
|
|
|
|
->orWhere(function ($query) use ($item) {
|
|
|
|
|
$query->where('pid', $item->id)->where('type', 2)->where('check', 2)->where('show', 1)->where('status', 1)->where('del', 2);
|
|
|
|
|
})
|
|
|
|
|
->orderBy('order', 'desc')->get();
|
|
|
|
|
}
|
|
|
|
|
|