初始版本

This commit is contained in:
贾祥聪
2025-08-19 14:16:51 +08:00
commit f937a1f9b9
4373 changed files with 359728 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\adminapi\logic\setting\system;
use app\common\logic\BaseLogic;
use app\common\service\ConfigService;
/**
* Class SystemLogic
* @package app\adminapi\logic\setting\system
*/
class SystemLogic extends BaseLogic
{
/**
* @notes 系统环境信息
* @return \array[][]
* @author 段誉
* @date 2021/12/28 18:35
*/
public static function getInfo() : array
{
$server = [
['param' => '服务器操作系统', 'value' => PHP_OS],
['param' => 'web服务器环境', 'value' => $_SERVER['SERVER_SOFTWARE']],
['param' => 'PHP版本', 'value' => PHP_VERSION],
];
$env = [
['option' => 'PHP版本', 'require' => '8.0版本以上', 'status' => (int)comparePHP('8.0.0'), 'remark' => '']
];
$auth = [
['dir' => '/runtime', 'require' => 'runtime目录可写', 'status' => (int)checkDirWrite('runtime'), 'remark' => ''],
];
return [
'server' => $server,
'env' => $env,
'auth' => $auth,
];
}
/**
* @notes 获取通用配置
* @return array[]
* @author cjhao
* @date 2024/8/27 17:21
*/
public static function getGeneralSetting()
{
$orderSetting = [
'order_cancel_order' => ConfigService::get('order_setting', 'order_cancel_order'),
'order_cancel_time' => ConfigService::get('order_setting', 'order_cancel_time'),
'over_time_comment' => ConfigService::get('order_setting', 'over_time_comment'),
'over_time_comment_content' => ConfigService::get('order_setting', 'over_time_comment_content')
];
$settleSetting = [
//结算方式
'commission_settle' => ConfigService::get('settle_setting', 'commission_settle'),
//结算周期1-按状态2-周期
'commission_settle_cycle' => ConfigService::get('settle_setting', 'commission_settle_cycle'),
//1-每周、2-每月
'commission_settle_cycle_type' => ConfigService::get('settle_setting', 'commission_settle_cycle_type'),
//订单结束X天后结算,每周X每月X号
'commission_settle_cycle_day' => ConfigService::get('settle_setting', 'commission_settle_cycle_day'),
];
$serverSetting = [
'advance_appoint' => ConfigService::get('server_setting', 'advance_appoint'),
'coach_order_limit' => ConfigService::get('server_setting', 'coach_order_limit'),
'coach_server_scope' => ConfigService::get('server_setting', 'coach_server_scope'),
'shop_coach_limit' => ConfigService::get('server_setting', 'shop_coach_limit'),
'shop_order_limit' => ConfigService::get('server_setting', 'shop_order_limit'),
];
return [
'order_setting' => $orderSetting,
'settle_setting' => $settleSetting,
'server_setting' => $serverSetting,
];
}
/**
* @notes 设置通用设置
* @param array $params
* @return true
* @author cjhao
* @date 2024/8/27 17:11
*/
public static function setGeneralSetting(array $params)
{
ConfigService::set('order_setting', 'order_cancel_order',$params['order_setting']['order_cancel_order']);
ConfigService::set('order_setting', 'order_cancel_time',$params['order_setting']['order_cancel_time']);
ConfigService::set('order_setting', 'over_time_comment',$params['order_setting']['over_time_comment']);
ConfigService::set('order_setting', 'over_time_comment_content',$params['order_setting']['over_time_comment_content']);
ConfigService::set('settle_setting', 'commission_settle',$params['settle_setting']['commission_settle']);
ConfigService::set('settle_setting', 'commission_settle_cycle',$params['settle_setting']['commission_settle_cycle']);
ConfigService::set('settle_setting', 'commission_settle_cycle_type',$params['settle_setting']['commission_settle_cycle_type']);
ConfigService::set('settle_setting', 'commission_settle_cycle_day',$params['settle_setting']['commission_settle_cycle_day']);
ConfigService::set('server_setting', 'advance_appoint',$params['server_setting']['advance_appoint']);
ConfigService::set('server_setting', 'coach_order_limit',$params['server_setting']['coach_order_limit']);
ConfigService::set('server_setting', 'coach_server_scope',$params['server_setting']['coach_server_scope']);
ConfigService::set('server_setting', 'shop_coach_limit',$params['server_setting']['shop_coach_limit']);
ConfigService::set('server_setting', 'shop_order_limit',$params['server_setting']['shop_order_limit']);
return true;
}
}