1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-11 09:00:42 +01:00

Fix per vista menu

This commit is contained in:
Pek5892 2024-03-21 11:32:43 +01:00
parent ca88797519
commit 780c67102f

View File

@ -177,9 +177,13 @@ class Module extends Model
public function children() public function children()
{ {
return $this->hasMany(self::class, 'parent')->withoutGlobalScope('enabled') return $this->hasMany(self::class, 'parent')
->withoutGlobalScope('enabled')
->selectRaw('zz_modules.*, zz_modules_lang.title as title') ->selectRaw('zz_modules.*, zz_modules_lang.title as title')
->join('zz_modules_lang', 'zz_modules.id', '=', 'zz_modules_lang.id_record') ->join('zz_modules_lang', function ($join) {
$join->on('zz_modules.id', '=', 'zz_modules_lang.id_record')
->where('zz_modules_lang.id_lang', '=', \Models\Locale::getDefault()->id);
})
->orderBy('order'); ->orderBy('order');
} }
@ -201,8 +205,11 @@ class Module extends Model
public static function getHierarchy() public static function getHierarchy()
{ {
return self::with('allChildren') return self::with('allChildren')
->selectRaw('zz_modules.*, zz_modules_lang.title as title') ->select('zz_modules.*', 'zz_modules_lang.title as title')
->join('zz_modules_lang', 'zz_modules.id', '=', 'zz_modules_lang.id_record') ->join('zz_modules_lang', function ($join) {
$join->on('zz_modules.id', '=', 'zz_modules_lang.id_record')
->where('zz_modules_lang.id_lang', '=', \Models\Locale::getDefault()->id);
})
->withoutGlobalScope('enabled') ->withoutGlobalScope('enabled')
->whereNull('parent') ->whereNull('parent')
->orderBy('order') ->orderBy('order')