mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:53:25 +08:00
【新增】新增微信扫码支付功能,对接PC端。
【新增】增加DTO类库,将逐步完善dto层。 【修复】修复【分类】切换后,切换回来未清零原始数据,导致更新数据重复的问题。 【调整】移除模板库功能,防止出现审核因为模板库页面存在而导致的审核失败。暂将模板库的代码存放到会员QQ群内,方便下载使用。 【调整】代码生成器【Repository.tpl】移除Cache手动增删改,【SqlSugarSetup】增加sqlsugar自动检测增删改后清理二级缓存。 【调整】后端新增秒杀独立组件,用于区分团购及秒杀的差异,首页新增秒杀组件。 【优化】重写首页所有组件样式及接口数据获取效率。 【优化】优化拼团,秒杀,团购,接龙数据获取逻辑,提升列表及详情页面数据获取效率。 【优化】调整拼团,秒杀,团购,服务商品推广海报为新式海报效果。增加服务商品推广海报。 【优化】清理h5相关代码判断,移除h5支付组件,提高响应速度。 【优化】移除小程序前端冗余代码。加快代码执行效率。
This commit is contained in:
@@ -4,23 +4,96 @@
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* CreateTime: 2022/10/24 3:54:14
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 文章分类表 接口实现
|
||||
/// 文章分类表 接口实现
|
||||
/// </summary>
|
||||
public class CoreCmsArticleTypeRepository : BaseRepository<CoreCmsArticleType>, ICoreCmsArticleTypeRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsArticleTypeRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsArticleType entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsArticleType entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsArticleType>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
//oldModel.id = entity.id;
|
||||
oldModel.name = entity.name;
|
||||
oldModel.parentId = entity.parentId;
|
||||
oldModel.sort = entity.sort;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsArticleType>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user