mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
【修复】修复mysql下报表统计异常问题,优化显示数量问题。
This commit is contained in:
@@ -19,6 +19,7 @@ using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.Echarts;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
@@ -83,12 +84,11 @@ namespace CoreCms.Net.Services
|
||||
select * from CoreCmsOrder
|
||||
where 1 = 1
|
||||
" + where + @"
|
||||
) o on tmp_x.x = ((cast(date(o." + joinVal + @") as signed) - " + sTime.ToString("yyyyMMdd") + @") div(" + section + @"))
|
||||
) o on tmp_x.x = ((unix_timestamp(o." + joinVal + @") - " + CommonHelper.ConvertDateTimeToInt(sTime) + @") div(" + section + @"))
|
||||
group by tmp_x.x
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine(sqlStr);
|
||||
var sp = new List<SugarParameter>();
|
||||
|
||||
var list = _dal.SqlQuery(sqlStr, sp);
|
||||
@@ -141,7 +141,7 @@ namespace CoreCms.Net.Services
|
||||
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 + @"))
|
||||
) o on tmp_x.x = ((unix_timestamp(o." + joinVal + @") - " + CommonHelper.ConvertDateTimeToInt(sTime) + @") div(" + section + @"))
|
||||
group by tmp_x.x
|
||||
";
|
||||
}
|
||||
@@ -201,7 +201,7 @@ namespace CoreCms.Net.Services
|
||||
select* from CoreCmsBillRefund
|
||||
where 1 = 1
|
||||
" + where + @"
|
||||
) o on tmp_x.x = ((cast(date(o." + joinVal + @") as signed) - " + sTime.ToString("yyyy-MM-dd") + @") div(" + section + @"))
|
||||
) o on tmp_x.x = ((unix_timestamp(o." + joinVal + @") - " + CommonHelper.ConvertDateTimeToInt(sTime) + @") div(" + section + @"))
|
||||
group by tmp_x.x
|
||||
";
|
||||
}
|
||||
@@ -258,7 +258,7 @@ namespace CoreCms.Net.Services
|
||||
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 + @"))
|
||||
) o on tmp_x.x = ((unix_timestamp(o." + joinVal + @") - " + CommonHelper.ConvertDateTimeToInt(sTime) + @") div(" + section + @"))
|
||||
group by tmp_x.x
|
||||
";
|
||||
}
|
||||
|
||||
@@ -733,5 +733,19 @@ namespace CoreCms.Net.Utility.Helper
|
||||
// 如果上传文件大于限定的容量
|
||||
return !(fileSize > size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 10位时间戳 转化
|
||||
/// </summary>
|
||||
/// <param name="time"></param>
|
||||
/// <returns></returns>
|
||||
public static long ConvertDateTimeToInt(System.DateTime time)
|
||||
{
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
|
||||
long t = (time.Ticks - startTime.Ticks) / 10000000; //除10000000调整为10位
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,29 +110,29 @@ namespace CoreCms.Net.Utility.Helper
|
||||
case 3600: //小时
|
||||
if (dateArr.num <= 24)
|
||||
{
|
||||
xType = "H时";
|
||||
xType = "d日H时";
|
||||
}
|
||||
else if (dateArr.num <= 720)
|
||||
{
|
||||
xType = "d日H时";
|
||||
xType = "M月d日H时";
|
||||
}
|
||||
else
|
||||
{
|
||||
xType = "m月d日H时";
|
||||
xType = "M月d日H时";
|
||||
}
|
||||
break;
|
||||
case 86400: //天
|
||||
if (dateArr.num <= 31)
|
||||
{
|
||||
xType = "d号";
|
||||
xType = "M月d号";
|
||||
}
|
||||
else if (dateArr.num <= 365)
|
||||
{
|
||||
xType = "m.d";
|
||||
xType = "yyyy年M月dd日";
|
||||
}
|
||||
else
|
||||
{
|
||||
xType = "Y.m.d";
|
||||
xType = "yyyy年M月dd日";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
defaultToolbar: ['filter', 'print', 'exports'],
|
||||
//height: 'full-127',
|
||||
page: false,
|
||||
limit: 30,
|
||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
limit: 8760,
|
||||
//limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
text: { none: '暂无相关数据' },
|
||||
totalRow: true,
|
||||
cols: [
|
||||
|
||||
@@ -85,8 +85,8 @@
|
||||
//height: 'full-127',
|
||||
page: false,
|
||||
cellMinWidth: '80',
|
||||
limit: 30,
|
||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
limit: 8760,
|
||||
//limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
text: { none: '暂无相关数据' },
|
||||
totalRow: true,
|
||||
cols: [
|
||||
|
||||
Reference in New Issue
Block a user