mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 17:37:20 +08:00
【修复】修复当新增或者删除会员等级后,【签到设置】连续签到规则数据错误,累计签到设置保存无效的问题。
This commit is contained in:
@@ -77,13 +77,13 @@ namespace CoreCms.Net.Repository
|
||||
days = item.days
|
||||
};
|
||||
|
||||
var id = await DbClient.Insertable(continuous).ExecuteReturnIdentityAsync();
|
||||
var id = await DbClient.Insertable(continuous).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
if (id <= 0) continue;
|
||||
foreach (var detail in item.details)
|
||||
{
|
||||
detail.ruleId = id;
|
||||
}
|
||||
await DbClient.Insertable(item.details).ExecuteReturnIdentityAsync();
|
||||
await DbClient.Insertable(item.details).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
}
|
||||
|
||||
_unitOfWork.CommitTran();
|
||||
@@ -103,13 +103,12 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// 获取的所有数据及子集
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsContinuousCheckInRules>> GetCaChe()
|
||||
public async Task<List<CoreCmsContinuousCheckInRules>> GetDataWidthChild()
|
||||
{
|
||||
var list = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
||||
.Select(p => new CoreCmsContinuousCheckInRules
|
||||
@@ -123,53 +122,5 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<IPageList<CoreCmsContinuousCheckInRules>> QueryPageAsync(Expression<Func<CoreCmsContinuousCheckInRules, bool>> predicate,
|
||||
Expression<Func<CoreCmsContinuousCheckInRules, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<CoreCmsContinuousCheckInRules> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsContinuousCheckInRules
|
||||
{
|
||||
id = p.id,
|
||||
days = p.days,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsContinuousCheckInRules
|
||||
{
|
||||
id = p.id,
|
||||
days = p.days,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<CoreCmsContinuousCheckInRules>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,29 +34,5 @@ namespace CoreCms.Net.Repository
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteCommandAsync();
|
||||
jm.code = 0;
|
||||
jm.msg = GlobalConstVars.EditSuccess;
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsCumulativeCheckInRules>> GetCaChe()
|
||||
{
|
||||
return await DbClient.Queryable<CoreCmsCumulativeCheckInRules>().With(SqlWith.NoLock).WithCache().ToListAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user