芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Models/ModuleSetting.php
where('type', 'admin'); } elseif (in_array('client', user_roles())) { $module = $module->where('type', 'client'); } elseif (in_array('employee', user_roles())) { $module = $module->where('type', 'employee'); } $module = $module->where('status', 'active'); $module = $module->first(); return (bool)$module; } public static function addCompanyIdToNullModule($company, $module) { // This is done for existing module settings. This will update the company id with 1 // for existing module rather creating new module setting if ($company->id == 1) { ModuleSetting::withoutGlobalScope(CompanyScope::class)->where('module_name', $module) ->whereNull('company_id') ->update(['company_id' => $company->id]); } } public static function createRoleSettingEntry($module, $roles, $company) { self::addCompanyIdToNullModule($company, $module); foreach ($roles as $role) { $data = ModuleSetting::withoutGlobalScope(CompanyScope::class) ->firstOrNew([ 'module_name' => $module, 'type' => $role, 'company_id' => $company->id ]); $data->saveQuietly(); } } }