From 192bc34c1a46af14319e6eeccba7d0217562084e Mon Sep 17 00:00:00 2001 From: zpc Date: Mon, 8 Dec 2025 00:57:23 +0800 Subject: [PATCH] 321 --- .../SystemSettingConstVars.cs | 12 +++++++++++- .../SystemSettingDictionary.cs | 4 +++- .../wwwroot/views/shop/setting/index.html | 14 ++++++++++++++ .../Controllers/CommonController.cs | 6 +++++- .../Controllers/SQController.cs | 16 +++++++++++++--- server/CoreCms.Net.Web.WebApi/Doc.xml | 2 +- 6 files changed, 47 insertions(+), 7 deletions(-) diff --git a/server/CoreCms.Net.Configuration/SystemSettingConstVars.cs b/server/CoreCms.Net.Configuration/SystemSettingConstVars.cs index 8abbdcb..b16bdba 100644 --- a/server/CoreCms.Net.Configuration/SystemSettingConstVars.cs +++ b/server/CoreCms.Net.Configuration/SystemSettingConstVars.cs @@ -1,4 +1,4 @@ -/*********************************************************************** +/*********************************************************************** * Project: CoreCms.Net * * Web: https://CoreCms.Net * * ProjectName: 核心内容管理系统 * @@ -31,6 +31,16 @@ namespace CoreCms.Net.Configuration /// public const string HomeAnnouncement = "homeAnnouncement"; + /// + /// 营业公告 + /// + public const string BusinessAnnouncement = "businessAnnouncement"; + + /// + /// 收益规则 + /// + public const string EarningsRule = "earningsRule"; + /// /// 平台地址 /// diff --git a/server/CoreCms.Net.Configuration/SystemSettingDictionary.cs b/server/CoreCms.Net.Configuration/SystemSettingDictionary.cs index 9cd2e5e..f9aaf23 100644 --- a/server/CoreCms.Net.Configuration/SystemSettingDictionary.cs +++ b/server/CoreCms.Net.Configuration/SystemSettingDictionary.cs @@ -1,4 +1,4 @@ -/*********************************************************************** +/*********************************************************************** * Project: CoreCms.Net * * Web: https://CoreCms.Net * * Projectname= 核心内容管理系统 * @@ -31,6 +31,8 @@ namespace CoreCms.Net.Configuration di.Add(SystemSettingConstVars.ShopName, new DictionaryKeyValues() { sKey = "平台名称", sValue = "核心内容管理系统" }); di.Add(SystemSettingConstVars.ShopDesc, new DictionaryKeyValues() { sKey = "平台描述", sValue = "平台描述会展示在前台及微信分享描述" }); di.Add(SystemSettingConstVars.HomeAnnouncement, new DictionaryKeyValues() { sKey = "首页公告栏", sValue = "" }); + di.Add(SystemSettingConstVars.BusinessAnnouncement, new DictionaryKeyValues() { sKey = "营业公告", sValue = "" }); + di.Add(SystemSettingConstVars.EarningsRule, new DictionaryKeyValues() { sKey = "收益规则", sValue = "" }); di.Add(SystemSettingConstVars.ShopAddress, new DictionaryKeyValues() { sKey = "平台地址", sValue = "我的平台地址" }); di.Add(SystemSettingConstVars.ShopBeiAn, new DictionaryKeyValues() { sKey = "备案信息", sValue = "网站备案信息" }); di.Add(SystemSettingConstVars.ShopLogo, new DictionaryKeyValues() { sKey = "平台logo", sValue = "" }); diff --git a/server/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html b/server/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html index 4985b7e..f7cc756 100644 --- a/server/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html +++ b/server/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html @@ -96,6 +96,20 @@
首页公告栏内容,可为空
+
+ +
+ +
+
营业公告内容,可为空
+
+
+ +
+ +
+
收益规则说明,可为空
+
diff --git a/server/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs b/server/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs index 3abffd7..1facbd9 100644 --- a/server/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs +++ b/server/CoreCms.Net.Web.WebApi/Controllers/CommonController.cs @@ -1,4 +1,4 @@ -/*********************************************************************** +/*********************************************************************** * Project: CoreCms * ProjectName: 核心内容管理系统 * Web: https://www.corecms.net @@ -134,6 +134,9 @@ namespace CoreCms.Net.Web.WebApi.Controllers //首页公告栏 var homeAnnouncement = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.HomeAnnouncement); + //营业公告 + var businessAnnouncement = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.BusinessAnnouncement); + //首页弹窗配置 var popupConfig = new { @@ -191,6 +194,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers userAgreementId, privacyPolicyId, homeAnnouncement, + businessAnnouncement, popupConfig, floatConfig, playingMethodOptions = options, diff --git a/server/CoreCms.Net.Web.WebApi/Controllers/SQController.cs b/server/CoreCms.Net.Web.WebApi/Controllers/SQController.cs index bcf174c..16e3fda 100644 --- a/server/CoreCms.Net.Web.WebApi/Controllers/SQController.cs +++ b/server/CoreCms.Net.Web.WebApi/Controllers/SQController.cs @@ -31,6 +31,7 @@ using NPOI.OpenXmlFormats.Dml; using Humanizer; using Newtonsoft.Json; using CoreCms.Net.Configuration; +using CoreCms.Net.Utility.Helper; namespace CoreCms.Net.Web.WebApi.Controllers; /// @@ -57,6 +58,7 @@ public class SQController : ControllerBase private readonly ISQRoomPricingServices _sQRoomPricingServices; private readonly ISQMessageServices _sQMessageServices; private readonly ISQEarningsServices _sQEarningsServices; + private readonly ICoreCmsSettingServices _settingServices; // 营业时间常量配置 private const string BUSINESS_OPEN_TIME = "09:00"; @@ -82,6 +84,7 @@ public class SQController : ControllerBase , ISQRoomPricingServices sQRoomPricingServices , ISQMessageServices sQMessageServices , ISQEarningsServices sQEarningsServices + , ICoreCmsSettingServices settingServices ) { _webHostEnvironment = webHostEnvironment; @@ -101,6 +104,7 @@ public class SQController : ControllerBase _sQRoomPricingServices = sQRoomPricingServices; _sQMessageServices = sQMessageServices; _sQEarningsServices = sQEarningsServices; + _settingServices = settingServices; } @@ -1930,9 +1934,15 @@ OFFSET {(pageIndex - 1) * pageSize} ROWS FETCH NEXT {pageSize} ROWS ONLY"; try { - // 从配置中获取收益规则说明,这里暂时返回默认内容 - // 后续可以从 CoreCmsSetting 表中读取配置 - var content = "收益规则说明:\n1. 收益来源于房间预约成功后的分成\n2. 收益可随时提现\n3. 提现将在3-5个工作日内到账\n4. 最低提现金额为0.01元"; + // 从配置中获取收益规则说明 + var allConfigs = await _settingServices.GetConfigDictionaries(); + var content = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.EarningsRule); + + // 如果配置为空,返回默认内容 + if (string.IsNullOrWhiteSpace(content)) + { + content = "收益规则说明:\n1. 收益来源于房间预约成功后的分成\n2. 收益可随时提现\n3. 提现将在3-5个工作日内到账\n4. 最低提现金额为0.01元"; + } jm.code = 0; jm.msg = "ok"; diff --git a/server/CoreCms.Net.Web.WebApi/Doc.xml b/server/CoreCms.Net.Web.WebApi/Doc.xml index 9b9d71e..8329e59 100644 --- a/server/CoreCms.Net.Web.WebApi/Doc.xml +++ b/server/CoreCms.Net.Web.WebApi/Doc.xml @@ -771,7 +771,7 @@ 预约接口 - + 构造函数