|
...
|
...
|
@@ -5,6 +5,7 @@ namespace App\Http\Logic\Aside\Manage; |
|
|
|
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Http\Logic\Aside\BaseLogic;
|
|
|
|
use App\Models\Manage\Group;
|
|
|
|
use App\Models\Manage\Menu;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
use Illuminate\Support\Str;
|
|
...
|
...
|
@@ -57,4 +58,20 @@ class MenuLogic extends BaseLogic |
|
|
|
}
|
|
|
|
return parent::delete($ids);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAllMenu(){
|
|
|
|
$map[] = ['type' => Menu::TYPE_MENU];
|
|
|
|
$map[] = ['status' => Menu::STATUS_NORMAL];
|
|
|
|
$list = parent::getList($map, ['id' => 'desc'], ['id', 'pid', 'title', 'icon', 'type'], 0);
|
|
|
|
return $this->success(Arr::listToTree($list));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMenuByGroupId($gid){
|
|
|
|
$rights = Group::where(['id' => $gid, 'status' => Group::STATUS_NORMAL])->pluck('rights')->first();
|
|
|
|
$map[] = ['type' => Menu::TYPE_MENU];
|
|
|
|
$map[] = ['status' => Menu::STATUS_NORMAL];
|
|
|
|
$map[] = ['id', 'in', $rights];
|
|
|
|
$list = parent::getList($map, ['id' => 'desc'], ['id', 'pid', 'title', 'icon', 'type'], 0);
|
|
|
|
return $this->success(Arr::listToTree($list));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|