From d7f6bed9acafdf6778cd794c128d2d6dd1802657 Mon Sep 17 00:00:00 2001 From: JianWeie Date: Fri, 25 Jun 2021 21:54:51 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8Dmysql=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E4=B8=8B,=E6=8A=A5=E8=A1=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1sql=E7=9A=84=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E3=80=822=E3=80=81=E4=B8=BA=E6=96=B9=E4=BE=BF=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E5=9C=A8=E4=B8=8D=E9=83=A8=E7=BD=B2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=8A=E5=90=8E=E7=AB=AF=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E6=B5=8B=E8=AF=95uni-app=E5=89=8D=E7=AB=AF=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=B5=8B=E8=AF=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=9C=B0=E5=9D=80=EF=BC=8C3=E3=80=81mysql=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Financial/CoreCmsReportsServices.cs | 38 ++++++------------- .../common/setting/constVarsHelper.js | 4 +- CoreCms.Net.Web.Admin/NLog.config | 2 +- CoreCms.Net.Web.Admin/appsettings.json | 8 ++-- CoreCms.Net.Web.WebApi/appsettings.json | 12 +++--- 5 files changed, 26 insertions(+), 38 deletions(-) diff --git a/CoreCms.Net.Services/Financial/CoreCmsReportsServices.cs b/CoreCms.Net.Services/Financial/CoreCmsReportsServices.cs index 34e456d..4c1ccb8 100644 --- a/CoreCms.Net.Services/Financial/CoreCmsReportsServices.cs +++ b/CoreCms.Net.Services/Financial/CoreCmsReportsServices.cs @@ -79,8 +79,8 @@ namespace CoreCms.Net.Services (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x2, (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x3, (SELECT @xi:=-1) x0 limit 0," + num + @") tmp_x - left join( - select* from CoreCmsOrder + left join ( + select * from CoreCmsOrder where 1 = 1 " + where + @" ) o on tmp_x.x = ((cast(date(o." + joinVal + @") as signed) - " + sTime.ToString("yyyy-MM-dd") + @") div(" + section + @")) @@ -90,10 +90,6 @@ namespace CoreCms.Net.Services var sp = new List(); - //sp.Add(section == 3600 ? new SugarParameter("@dataType", "HOUR") : new SugarParameter("@dataType", "DAY")); - //sp.Add(new SugarParameter("@sTime", sTime.ToString("yyyy-MM-dd HH:mm:ss"))); - //sp.Add(new SugarParameter("@where", where)); - //sp.Add(new SugarParameter("@num", num)); var list = _dal.SqlQuery(sqlStr, sp); @@ -140,10 +136,10 @@ namespace CoreCms.Net.Services (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x1, (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x2, (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x3, - (SELECT @xi:=-1) x0 limit 0," + num + @") tmp_x - left join( - select* from CoreCmsBillPayments - where 1 = 1 + (SELECT @xi:=-1) x0 limit 0," + num + @") tmp_x + left join ( + select * from CoreCmsBillPayments + where 1 = 1 " + where + @" ) o on tmp_x.x = ((cast(date(o." + joinVal + @") as signed) - " + sTime.ToString("yyyy-MM-dd") + @") div(" + section + @")) group by tmp_x.x @@ -151,10 +147,7 @@ namespace CoreCms.Net.Services } var sp = new List(); - //sp.Add(section == 3600 ? new SugarParameter("@dataType", "HOUR") : new SugarParameter("@dataType", "DAY")); - //sp.Add(new SugarParameter("@sTime", sTime.ToString("yyyy-MM-dd HH:mm:ss"))); - //sp.Add(new SugarParameter("@where", where)); - //sp.Add(new SugarParameter("@num", num)); + var list = _dal.SqlQuery(sqlStr, sp); @@ -214,10 +207,7 @@ namespace CoreCms.Net.Services } var sp = new List(); - //sp.Add(section == 3600 ? new SugarParameter("@dataType", "HOUR") : new SugarParameter("@dataType", "DAY")); - //sp.Add(new SugarParameter("@sTime", sTime.ToString("yyyy-MM-dd HH:mm:ss"))); - //sp.Add(new SugarParameter("@where", where)); - //sp.Add(new SugarParameter("@num", num)); + var list = _dal.SqlQuery(sqlStr, sp); return list; @@ -263,10 +253,10 @@ namespace CoreCms.Net.Services (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x1, (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x2, (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10) x3, - (SELECT @xi:=-1) x0 limit 0," + num + @") tmp_x - left join( - select* from CoreCmsUserTocash - where 1 = 1 + (SELECT @xi:=-1) x0 limit 0," + num + @") tmp_x + left join ( + select * from CoreCmsUserTocash + where 1 = 1 " + where + @" ) o on tmp_x.x = ((cast(date(o." + joinVal + @") as signed) - " + sTime.ToString("yyyy-MM-dd") + @") div(" + section + @")) group by tmp_x.x @@ -274,10 +264,6 @@ namespace CoreCms.Net.Services } var sp = new List(); - //sp.Add(section == 3600 ? new SugarParameter("@dataType", "HOUR") : new SugarParameter("@dataType", "DAY")); - //sp.Add(new SugarParameter("@sTime", sTime.ToString("yyyy-MM-dd HH:mm:ss"))); - //sp.Add(new SugarParameter("@where", where)); - sp.Add(new SugarParameter("@xi", num)); var list = _dal.SqlQuery(sqlStr, sp); diff --git a/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js index 8187c2a..225d435 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js @@ -2,8 +2,8 @@ * CoreShop全局配置文件 * @version 1.0.0 */ -//接口请求地址 -export const apiBaseUrl = 'https://api.demo.coreshop.com.cn'; +//接口请求地址,如果需要不部署接口端的情况下测试uni-app,可以直接替换为官方测试接口:https://api.coreshop.corecms.net +export const apiBaseUrl = 'https://api.coreshop.corecms.net'; //项目静态资源请求地址,如果使用官方的静态文件地址可以直接替换为:https://files.coreshop.corecms.net export const apiFilesUrl = 'https://files.coreshop.corecms.net'; diff --git a/CoreCms.Net.Web.Admin/NLog.config b/CoreCms.Net.Web.Admin/NLog.config index c393d38..84bd7fb 100644 --- a/CoreCms.Net.Web.Admin/NLog.config +++ b/CoreCms.Net.Web.Admin/NLog.config @@ -14,7 +14,7 @@ dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456" --> - + INSERT INTO SysNLogRecords (LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod diff --git a/CoreCms.Net.Web.Admin/appsettings.json b/CoreCms.Net.Web.Admin/appsettings.json index 2f58d4b..6ba44b8 100644 --- a/CoreCms.Net.Web.Admin/appsettings.json +++ b/CoreCms.Net.Web.Admin/appsettings.json @@ -5,7 +5,7 @@ //SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】 // 如果采用容器化部署Service 要写成mysql的服务名,否则写地址 - "SqlConnection": "Server=mysql;Port=3306;Database=CoreShop;Uid=root;Pwd=admin" + "SqlConnection": "Server=127.0.0.1;Port=3306;Database=CoreShop;Uid=CoreShop;Pwd=CoreShop;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true" // Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上 }, //定时任务管理面板的账户密码 @@ -14,15 +14,15 @@ "PassWord": "CoreShop" }, "AppConfig": { - "AppUrl": "https://admin.demo.CoreShop.com.cn/", //后端管理地址 - "AppInterFaceUrl": "https://api.demo.CoreShop.com.cn/" //接口请求地址 + "AppUrl": "https://admin.coreshop.corecms.net/", //后端管理地址 + "AppInterFaceUrl": "https://api.coreshop.corecms.net/" //接口请求地址 }, //redis为必须启动项,请保持redis为正常可用 "RedisConfig": { "Enabled": false, //启用redis作为内存选择 "UseRedisMessageQueue": false, //启用redis作为队列选择 // 如果采用容器化部署Service 要写成redis的服务名,否则写地址 - "ConnectionString": "redis:6379,password=123456,connectTimeout=1000,connectRetry=1,syncTimeout=10000,DefaultDatabase=8" //redis数据库连接字符串 + "ConnectionString": "127.0.0.1:6379,password=CoreShop,connectTimeout=3000,connectRetry=1,syncTimeout=10000,DefaultDatabase=10" //redis数据库连接字符串 }, //jwt授权认证的一些设置 "JwtConfig": { diff --git a/CoreCms.Net.Web.WebApi/appsettings.json b/CoreCms.Net.Web.WebApi/appsettings.json index df77b28..6ba44b8 100644 --- a/CoreCms.Net.Web.WebApi/appsettings.json +++ b/CoreCms.Net.Web.WebApi/appsettings.json @@ -4,8 +4,9 @@ //"SqlConnection": "Server=127.0.0.1;uid=CoreShop;pwd=CoreShop;Database=CoreShop;MultipleActiveResultSets=true;" //SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】 - "SqlConnection": "Server=mysql;Port=3306;Database=CoreShop;Uid=root;Pwd=admin" - // Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上, + // 如果采用容器化部署Service 要写成mysql的服务名,否则写地址 + "SqlConnection": "Server=127.0.0.1;Port=3306;Database=CoreShop;Uid=CoreShop;Pwd=CoreShop;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true" + // Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上 }, //定时任务管理面板的账户密码 "HangFire": { @@ -13,14 +14,15 @@ "PassWord": "CoreShop" }, "AppConfig": { - "AppUrl": "https://admin.demo.CoreShop.com.cn/", //后端管理地址 - "AppInterFaceUrl": "https://api.demo.CoreShop.com.cn/" //接口请求地址 + "AppUrl": "https://admin.coreshop.corecms.net/", //后端管理地址 + "AppInterFaceUrl": "https://api.coreshop.corecms.net/" //接口请求地址 }, //redis为必须启动项,请保持redis为正常可用 "RedisConfig": { "Enabled": false, //启用redis作为内存选择 "UseRedisMessageQueue": false, //启用redis作为队列选择 - "ConnectionString": "redis:6379,password=123456,connectTimeout=1000,connectRetry=1,syncTimeout=10000,DefaultDatabase=8" //redis数据库连接字符串 + // 如果采用容器化部署Service 要写成redis的服务名,否则写地址 + "ConnectionString": "127.0.0.1:6379,password=CoreShop,connectTimeout=3000,connectRetry=1,syncTimeout=10000,DefaultDatabase=10" //redis数据库连接字符串 }, //jwt授权认证的一些设置 "JwtConfig": {