mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:43:26 +08:00
【新增】后台用户列表,积分调整为可用积分,增加累计积分列及可点击列表展示。
This commit is contained in:
@@ -34,5 +34,14 @@ namespace CoreCms.Net.Model.Entities
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public string parentNickName { get; set; }
|
public string parentNickName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 累计积分
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public int accumulativePoint { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,6 @@ using CoreCms.Net.Model.Entities.Expression;
|
|||||||
using CoreCms.Net.Model.FromBody;
|
using CoreCms.Net.Model.FromBody;
|
||||||
using CoreCms.Net.Model.ViewModels.Basics;
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using CoreCms.Net.Model.ViewModels.DTO;
|
|
||||||
using CoreCms.Net.Utility.Extensions;
|
using CoreCms.Net.Utility.Extensions;
|
||||||
using CoreCms.Net.Utility.Helper;
|
using CoreCms.Net.Utility.Helper;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
@@ -52,6 +51,7 @@ namespace CoreCms.Net.Repository
|
|||||||
//本月第一天时间
|
//本月第一天时间
|
||||||
DateTime dtFirst = dt.AddDays(1 - (dt.Day));
|
DateTime dtFirst = dt.AddDays(1 - (dt.Day));
|
||||||
dtFirst = new DateTime(dtFirst.Year, dtFirst.Month, dtFirst.Day, 0, 0, 0);
|
dtFirst = new DateTime(dtFirst.Year, dtFirst.Month, dtFirst.Day, 0, 0, 0);
|
||||||
|
|
||||||
//获得某年某月的天数
|
//获得某年某月的天数
|
||||||
int year = dt.Date.Year;
|
int year = dt.Date.Year;
|
||||||
int month = dt.Date.Month;
|
int month = dt.Date.Month;
|
||||||
@@ -133,7 +133,8 @@ namespace CoreCms.Net.Repository
|
|||||||
isDelete = p.isDelete,
|
isDelete = p.isDelete,
|
||||||
type = (int)sWeChatInfo.type,
|
type = (int)sWeChatInfo.type,
|
||||||
parentNickName = sParentUser.nickName,
|
parentNickName = sParentUser.nickName,
|
||||||
childNum = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.parentId == p.id).Count()
|
childNum = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.parentId == p.id).Count(),
|
||||||
|
accumulativePoint = SqlFunc.Subqueryable<CoreCmsUserPointLog>().Where(o => o.userId == p.id && o.num > 0).Sum(c => c.num),
|
||||||
})
|
})
|
||||||
.MergeTable().With(SqlWith.Null)
|
.MergeTable().With(SqlWith.Null)
|
||||||
.OrderBy(orderByExpression, orderByType)
|
.OrderBy(orderByExpression, orderByType)
|
||||||
@@ -179,7 +180,7 @@ namespace CoreCms.Net.Repository
|
|||||||
{
|
{
|
||||||
var dt = DateTime.Now;
|
var dt = DateTime.Now;
|
||||||
var where = PredicateBuilder.True<CoreCmsOrder>();
|
var where = PredicateBuilder.True<CoreCmsOrder>();
|
||||||
var currDay = DateTime.Now.ToString("yyyy-MM-dd");
|
string currDay;
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
where = where.And(p => p.createTime < DateTime.Now);
|
where = where.And(p => p.createTime < DateTime.Now);
|
||||||
|
|||||||
@@ -1256,15 +1256,15 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取列表============================================================
|
#region 获取积分列表============================================================
|
||||||
|
|
||||||
// POST: Api/CoreCmsUser/GetUserPointLogPageList
|
// POST: Api/CoreCmsUser/GetUserPointLogPageList
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取列表
|
/// 获取积分列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Description("获取列表")]
|
[Description("获取积分列表")]
|
||||||
public async Task<AdminUiCallBack> GetUserPointLogPageList()
|
public async Task<AdminUiCallBack> GetUserPointLogPageList()
|
||||||
{
|
{
|
||||||
var jm = new AdminUiCallBack();
|
var jm = new AdminUiCallBack();
|
||||||
@@ -1349,6 +1349,14 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//积分余额 int
|
||||||
|
var searchType = Request.Form["searchType"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(searchType) && searchType == "accumulativePoint")
|
||||||
|
{
|
||||||
|
where = where.And(p => p.num > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取数据
|
//获取数据
|
||||||
var list = await _coreCmsUserPointLogServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent,
|
var list = await _coreCmsUserPointLogServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent,
|
||||||
pageSize);
|
pageSize);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
defaultToolbar: ['filter', 'print', 'exports'],
|
defaultToolbar: ['filter', 'print', 'exports'],
|
||||||
//height: 'full-127',//无面包屑127,搜索框189,1行62
|
//height: 'full-127',//无面包屑127,搜索框189,1行62
|
||||||
where: { userId: d.params.id },
|
where: { userId: d.params.id, searchType: d.params.searchType },
|
||||||
page: true,
|
page: true,
|
||||||
limit: 30,
|
limit: 30,
|
||||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||||
|
|||||||
@@ -219,11 +219,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'point', title: '积分', sort: false, width: 70, templet: function (data) {
|
field: 'point', title: '可用积分', sort: false, width: 70, templet: function (data) {
|
||||||
var html = '<a class="link-hot option-show point" data-id="' + data.id + '">' + data.point + '</a>';
|
var html = '<a class="link-hot option-show point" data-id="' + data.id + '">' + data.point + '</a>';
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'accumulativePoint', title: '累计积分', sort: false, width: 70, templet: function (data) {
|
||||||
|
var html = '<a class="link-hot option-show point" data-id="' + data.id + '" data-type="accumulativePoint">' + data.accumulativePoint + '</a>';
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'grade', title: '用户等级', sort: false, width: 105, templet: function (data) {
|
field: 'grade', title: '用户等级', sort: false, width: 105, templet: function (data) {
|
||||||
if (data.grade) {
|
if (data.grade) {
|
||||||
@@ -560,6 +566,7 @@
|
|||||||
//积分记录
|
//积分记录
|
||||||
$(document).on('click', '.point', function () {
|
$(document).on('click', '.point', function () {
|
||||||
var id = $(this).attr('data-id');
|
var id = $(this).attr('data-id');
|
||||||
|
var searchType = $(this).attr('data-type');
|
||||||
coreHelper.Post("Api/CoreCmsUser/GetDetailsPointLog", { id: id }, function (e) {
|
coreHelper.Post("Api/CoreCmsUser/GetDetailsPointLog", { id: id }, function (e) {
|
||||||
if (e.code === 0) {
|
if (e.code === 0) {
|
||||||
admin.popup({
|
admin.popup({
|
||||||
@@ -568,7 +575,7 @@
|
|||||||
area: ['90%', '90%'],
|
area: ['90%', '90%'],
|
||||||
id: 'LAY-popup-CoreCmsUser-details',
|
id: 'LAY-popup-CoreCmsUser-details',
|
||||||
success: function (layero, index) {
|
success: function (layero, index) {
|
||||||
view(this.id).render('user/userInfo/detailsPointLog', { data: e.data, id: id }).done(function () {
|
view(this.id).render('user/userInfo/detailsPointLog', { data: e.data, id: id, searchType: searchType }).done(function () {
|
||||||
form.render();
|
form.render();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -581,6 +588,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//余额明细
|
//余额明细
|
||||||
$(document).on('click', '.balance', function () {
|
$(document).on('click', '.balance', function () {
|
||||||
var id = $(this).attr('data-id');
|
var id = $(this).attr('data-id');
|
||||||
|
|||||||
Reference in New Issue
Block a user