Files
huangjingfen/pro_v3.5.1/app/services/system/LocalCopyrightService.php
2026-04-29 17:16:59 +08:00

50 lines
1.6 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace app\services\system;
use app\services\system\config\SystemConfigServices;
use crmeb\services\SystemConfigService;
/**
* 本项目自有版权信息服务,不表达 CRMEB 原厂授权状态。
*/
class LocalCopyrightService
{
public function getCopyright(): array
{
$config = SystemConfigService::more([
['copyright', ''],
['copyright_img', ''],
]);
return [
'copyrightContext' => $config['copyright'] ?? '',
'copyrightImage' => $config['copyright_img'] ?? '',
'version' => function_exists('get_crmeb_version') ? get_crmeb_version() : '',
];
}
public function saveCopyright(string $copyright = '', string $copyrightImg = ''): void
{
/** @var SystemConfigServices $services */
$services = app()->make(SystemConfigServices::class);
$services->update('copyright', ['value' => json_encode($copyright, JSON_UNESCAPED_UNICODE)], 'menu_name');
$services->update('copyright_img', ['value' => json_encode($copyrightImg, JSON_UNESCAPED_UNICODE)], 'menu_name');
SystemConfigService::clear();
}
public function getSystemLicenseInfo(): array
{
return [
'edition' => 'custom',
'license_source' => 'self-owned',
'crm_pro_authorized' => false,
'copyright' => $this->getCopyright(),
];
}
}