79 lines
3.9 KiB
PHP
Executable File
79 lines
3.9 KiB
PHP
Executable File
<?php
|
|
namespace app\adminapi\logic\setting;
|
|
use app\common\service\ConfigService;
|
|
use app\common\service\FileService;
|
|
|
|
/**
|
|
* 基础设置
|
|
* Class BaseLogic
|
|
* @package app\adminapi\logic\setting
|
|
*/
|
|
class BaseLogic {
|
|
|
|
|
|
/**
|
|
* @notes 获取获取
|
|
* @return array[]
|
|
* @author cjhao
|
|
* @date 2024/11/1 13:07
|
|
*/
|
|
public function getConfig(){
|
|
return [
|
|
// 'platform' => [
|
|
'platform_name' => ConfigService::get('platform', 'platform_name',''),
|
|
'platform_logo' => FileService::getFileUrl(ConfigService::get('platform', 'platform_logo','')),
|
|
'poster' => FileService::getFileUrl(ConfigService::get('platform', 'poster','')),
|
|
'icon' => FileService::getFileUrl(ConfigService::get('platform', 'icon','')),
|
|
'safety_login' => ConfigService::get('platform', 'safety_login',1),
|
|
'safety_limit' => ConfigService::get('platform', 'safety_limit',3),
|
|
'safety_limit_time' => ConfigService::get('platform', 'safety_limit_time',5),
|
|
'doc_show' => ConfigService::get('platform', 'doc_show',1),
|
|
'contacts' => ConfigService::get('platform', 'contacts',''),
|
|
'mobile' => ConfigService::get('platform', 'mobile',''),
|
|
'service_mobile' => ConfigService::get('platform', 'service_mobile',''),
|
|
// ],
|
|
// 'user' => [
|
|
'user_name' => ConfigService::get('user', 'user_name',''),
|
|
'short_name' => ConfigService::get('user', 'short_name',''),
|
|
'user_logo' => FileService::getFileUrl(ConfigService::get('user', 'user_logo','')),
|
|
// ],
|
|
// 'coach' => [
|
|
'coach_name' => ConfigService::get('coach', 'coach_name',''),
|
|
'coach_logo' => FileService::getFileUrl(ConfigService::get('coach', 'coach_logo','')),
|
|
// ],
|
|
// 'shop' => [
|
|
'shop_name' => ConfigService::get('shop', 'shop_name',''),
|
|
'shop_logo' => FileService::getFileUrl(ConfigService::get('shop', 'shop_logo','')),
|
|
// ],
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 设置基础设置
|
|
* @param $params
|
|
* @return void
|
|
* @author cjhao
|
|
* @date 2024/11/1 13:18
|
|
*/
|
|
public function setConfig($params){
|
|
ConfigService::set('platform', 'platform_name',$params['platform_name']);
|
|
ConfigService::set('platform', 'platform_logo',FileService::setFileUrl($params['platform_logo']));
|
|
ConfigService::set('platform', 'poster',FileService::setFileUrl($params['poster']));
|
|
ConfigService::set('platform', 'icon',FileService::setFileUrl($params['icon']));
|
|
ConfigService::set('platform', 'safety_login',$params['safety_login']);
|
|
ConfigService::set('platform', 'safety_limit',$params['safety_limit']);
|
|
ConfigService::set('platform', 'doc_show',$params['doc_show']);
|
|
ConfigService::set('platform', 'safety_limit',$params['safety_limit']);
|
|
ConfigService::set('platform', 'contacts',$params['contacts']);
|
|
ConfigService::set('platform', 'mobile',$params['mobile']);
|
|
ConfigService::set('platform', 'service_mobile',$params['service_mobile']);
|
|
ConfigService::set('user', 'user_name',$params['user_name']);
|
|
ConfigService::set('user', 'short_name',$params['short_name']);
|
|
ConfigService::set('user', 'user_logo',FileService::setFileUrl($params['user_logo']));
|
|
ConfigService::set('coach', 'coach_name',$params['coach_name']);
|
|
ConfigService::set('coach', 'coach_logo',$params['coach_logo']);
|
|
ConfigService::set('shop', 'shop_name',$params['shop_name']);
|
|
ConfigService::set('shop', 'shop_logo',FileService::setFileUrl($params['shop_logo']));
|
|
}
|
|
} |