mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:03:27 +08:00
完成充值功能整体开发。
This commit is contained in:
@@ -285,6 +285,11 @@ namespace CoreCms.Net.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("邀请用户注册")]
|
[Description("邀请用户注册")]
|
||||||
PointTypeInviterUser = 9,
|
PointTypeInviterUser = 9,
|
||||||
|
/// <summary>
|
||||||
|
/// 充值赠送积分
|
||||||
|
/// </summary>
|
||||||
|
[Description("充值赠送积分")]
|
||||||
|
PointTypeTopUp = 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -3279,5 +3284,86 @@ namespace CoreCms.Net.Configuration
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 小程序直播
|
||||||
|
/// <summary>
|
||||||
|
/// 直播类型
|
||||||
|
/// </summary>
|
||||||
|
public enum LiveBroadCastLiveType
|
||||||
|
{
|
||||||
|
推流 = 1,
|
||||||
|
手机直播 = 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 价格类型
|
||||||
|
/// </summary>
|
||||||
|
public enum LiveBroadCastGoodPriceType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 一口价(只需要传入price,price2不传)
|
||||||
|
/// </summary>
|
||||||
|
一口价 = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 价格区间(price字段为左边界,price2字段为右边界,price和price2必传)
|
||||||
|
/// </summary>
|
||||||
|
价格区间 = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示折扣价(price字段为原价,price2字段为现价, price和price2必传)
|
||||||
|
/// </summary>
|
||||||
|
显示折扣价 = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 直播状态
|
||||||
|
/// </summary>
|
||||||
|
public enum LiveBroadCastLiveStatus
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 直播中
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-xs\">直播中</button>")]
|
||||||
|
直播中 = 101,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 未开始
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-primary layui-btn-xs\">未开始</button>")]
|
||||||
|
未开始 = 102,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 已结束
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-disabled layui-btn-xs\">已结束</button>")]
|
||||||
|
已结束 = 103,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 禁播
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-danger layui-btn-xs\">禁播</button>")]
|
||||||
|
禁播 = 104,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 暂停
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-normal layui-btn-xs\">暂停</button>")]
|
||||||
|
暂停 = 105,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 异常
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-warm layui-btn-xs\">异常</button>")]
|
||||||
|
异常 = 106,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 已过期
|
||||||
|
/// </summary>
|
||||||
|
[Description("<button type=\"button\" class=\"layui-btn layui-btn-disabled layui-btn-xs\">已过期</button>")]
|
||||||
|
已过期 = 107,
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
82
CoreCms.Net.IRepository/Shop/ICoreCmsTopUpTypeRepository.cs
Normal file
82
CoreCms.Net.IRepository/Shop/ICoreCmsTopUpTypeRepository.cs
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2023/3/20 21:20:30
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
||||||
|
namespace CoreCms.Net.IRepository
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 充值类型 工厂接口
|
||||||
|
/// </summary>
|
||||||
|
public interface ICoreCmsTopUpTypeRepository : IBaseRepository<CoreCmsTopUpType>
|
||||||
|
{
|
||||||
|
#region 重写增删改查操作===========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> InsertAsync(CoreCmsTopUpType entity);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> UpdateAsync(CoreCmsTopUpType entity);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取缓存的所有数据==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取缓存的所有数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<CoreCmsTopUpType>> GetCaChe();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
Task<IPageList<CoreCmsTopUpType>> QueryPageAsync(
|
||||||
|
Expression<Func<CoreCmsTopUpType, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsTopUpType, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,7 +48,7 @@ namespace CoreCms.Net.IServices
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 支付,先生成支付单,然后去支付
|
/// 支付,先生成支付单,然后去支付
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sourceStr">来源,一般是订单号或者用户id,比如充值</param>
|
/// <param name="sourceStr">来源,一般是订单号或者用户id</param>
|
||||||
/// <param name="paymentCode">支付方式</param>
|
/// <param name="paymentCode">支付方式</param>
|
||||||
/// <param name="userId">用户序列</param>
|
/// <param name="userId">用户序列</param>
|
||||||
/// <param name="type">订单/充值/服务项目</param>
|
/// <param name="type">订单/充值/服务项目</param>
|
||||||
|
|||||||
80
CoreCms.Net.IServices/Shop/ICoreCmsTopUpTypeServices.cs
Normal file
80
CoreCms.Net.IServices/Shop/ICoreCmsTopUpTypeServices.cs
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2023/3/20 21:20:30
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.IServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 充值类型 服务工厂接口
|
||||||
|
/// </summary>
|
||||||
|
public interface ICoreCmsTopUpTypeServices : IBaseServices<CoreCmsTopUpType>
|
||||||
|
{
|
||||||
|
#region 重写增删改查操作===========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> InsertAsync(CoreCmsTopUpType entity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> UpdateAsync(CoreCmsTopUpType entity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取缓存的所有数据==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取缓存的所有数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<CoreCmsTopUpType>> GetCaChe();
|
||||||
|
|
||||||
|
#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>
|
||||||
|
Task<IPageList<CoreCmsTopUpType>> QueryPageAsync(
|
||||||
|
Expression<Func<CoreCmsTopUpType, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsTopUpType, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false);
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6211,6 +6211,56 @@
|
|||||||
距离说明
|
距离说明
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Model.Entities.CoreCmsTopUpType">
|
||||||
|
<summary>
|
||||||
|
充值类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Model.Entities.CoreCmsTopUpType.#ctor">
|
||||||
|
<summary>
|
||||||
|
构造函数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.id">
|
||||||
|
<summary>
|
||||||
|
序列
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.title">
|
||||||
|
<summary>
|
||||||
|
标题
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.defaultMoney">
|
||||||
|
<summary>
|
||||||
|
充值金额
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.giftMoney">
|
||||||
|
<summary>
|
||||||
|
赠送金额
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.giftPoint">
|
||||||
|
<summary>
|
||||||
|
赠送积分
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.sortId">
|
||||||
|
<summary>
|
||||||
|
显示排序
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.isEnable">
|
||||||
|
<summary>
|
||||||
|
是否启用
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.Entities.CoreCmsTopUpType.description">
|
||||||
|
<summary>
|
||||||
|
说明
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.Entities.CoreCmsSolitaire">
|
<member name="T:CoreCms.Net.Model.Entities.CoreCmsSolitaire">
|
||||||
<summary>
|
<summary>
|
||||||
接龙活动表
|
接龙活动表
|
||||||
@@ -10622,6 +10672,11 @@
|
|||||||
用户前端编码
|
用户前端编码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.FromBody.FMWxPost.type">
|
||||||
|
<summary>
|
||||||
|
来源类型(对标GlobalEnumVars下的UserAccountTypes)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.FromBody.FMWxLoginDecodeEncryptedData">
|
<member name="T:CoreCms.Net.Model.FromBody.FMWxLoginDecodeEncryptedData">
|
||||||
<summary>
|
<summary>
|
||||||
微信小程序登录解码数据
|
微信小程序登录解码数据
|
||||||
|
|||||||
92
CoreCms.Net.Model/Entities/Shop/CoreCmsTopUpType.cs
Normal file
92
CoreCms.Net.Model/Entities/Shop/CoreCmsTopUpType.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2023/3/20 21:20:30
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Model.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 充值类型
|
||||||
|
/// </summary>
|
||||||
|
public class CoreCmsTopUpType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
/// </summary>
|
||||||
|
public CoreCmsTopUpType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 序列
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "序列")]
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public int id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标题
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "标题")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
[StringLength(50, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public string title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 充值金额
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "充值金额")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public int defaultMoney { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 赠送金额
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "赠送金额")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public int giftMoney { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 赠送积分
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "赠送积分")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public int giftPoint { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示排序
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "显示排序")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public int sortId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "是否启用")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
public bool isEnable { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 说明
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "说明")]
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
[StringLength(100, ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
public string description { get; set; }
|
||||||
|
}
|
||||||
180
CoreCms.Net.Repository/Shop/CoreCmsTopUpTypeRepository.cs
Normal file
180
CoreCms.Net.Repository/Shop/CoreCmsTopUpTypeRepository.cs
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2023/3/20 21:20:30
|
||||||
|
* 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.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Repository
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 充值类型 接口实现
|
||||||
|
/// </summary>
|
||||||
|
public class CoreCmsTopUpTypeRepository : BaseRepository<CoreCmsTopUpType>, ICoreCmsTopUpTypeRepository
|
||||||
|
{
|
||||||
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
|
public CoreCmsTopUpTypeRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||||
|
{
|
||||||
|
_unitOfWork = unitOfWork;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 实现重写增删改查操作==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">实体数据</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> InsertAsync(CoreCmsTopUpType entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var bl = await DbClient.Insertable(entity).RemoveDataCache().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(CoreCmsTopUpType entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var oldModel = await DbClient.Queryable<CoreCmsTopUpType>().In(entity.id).SingleAsync();
|
||||||
|
if (oldModel == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
//事物处理过程开始
|
||||||
|
oldModel.id = entity.id;
|
||||||
|
oldModel.title = entity.title;
|
||||||
|
oldModel.description = entity.description;
|
||||||
|
oldModel.defaultMoney = entity.defaultMoney;
|
||||||
|
oldModel.giftMoney = entity.giftMoney;
|
||||||
|
oldModel.giftPoint = entity.giftPoint;
|
||||||
|
oldModel.sortId = entity.sortId;
|
||||||
|
oldModel.isEnable = entity.isEnable;
|
||||||
|
|
||||||
|
//事物处理过程结束
|
||||||
|
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().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<CoreCmsTopUpType>(id).ExecuteCommandHasChangeAsync();
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取缓存的所有数据==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取缓存的所有数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<CoreCmsTopUpType>> GetCaChe()
|
||||||
|
{
|
||||||
|
var list = await DbClient.Queryable<CoreCmsTopUpType>().With(SqlWith.NoLock).WithCache().ToListAsync();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
#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<CoreCmsTopUpType>> QueryPageAsync(Expression<Func<CoreCmsTopUpType, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsTopUpType, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false)
|
||||||
|
{
|
||||||
|
RefAsync<int> totalCount = 0;
|
||||||
|
List<CoreCmsTopUpType> page;
|
||||||
|
if (blUseNoLock)
|
||||||
|
{
|
||||||
|
page = await DbClient.Queryable<CoreCmsTopUpType>()
|
||||||
|
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||||
|
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsTopUpType
|
||||||
|
{
|
||||||
|
id = p.id,
|
||||||
|
title = p.title,
|
||||||
|
description = p.description,
|
||||||
|
defaultMoney = p.defaultMoney,
|
||||||
|
giftMoney = p.giftMoney,
|
||||||
|
giftPoint = p.giftPoint,
|
||||||
|
sortId = p.sortId,
|
||||||
|
isEnable = p.isEnable,
|
||||||
|
|
||||||
|
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
page = await DbClient.Queryable<CoreCmsTopUpType>()
|
||||||
|
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||||
|
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsTopUpType
|
||||||
|
{
|
||||||
|
id = p.id,
|
||||||
|
title = p.title,
|
||||||
|
description = p.description,
|
||||||
|
defaultMoney = p.defaultMoney,
|
||||||
|
giftMoney = p.giftMoney,
|
||||||
|
giftPoint = p.giftPoint,
|
||||||
|
sortId = p.sortId,
|
||||||
|
isEnable = p.isEnable,
|
||||||
|
|
||||||
|
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||||
|
}
|
||||||
|
var list = new PageList<CoreCmsTopUpType>(page, pageIndex, pageSize, totalCount);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,6 +58,8 @@ namespace CoreCms.Net.Services
|
|||||||
private readonly ICoreCmsServicesServices _servicesServices;
|
private readonly ICoreCmsServicesServices _servicesServices;
|
||||||
private readonly ICoreCmsUserServicesOrderServices _userServicesOrderServices;
|
private readonly ICoreCmsUserServicesOrderServices _userServicesOrderServices;
|
||||||
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
||||||
|
private readonly ICoreCmsTopUpTypeServices _topUpTypeServices;
|
||||||
|
private readonly ICoreCmsUserPointLogServices _userPointLogServices;
|
||||||
private readonly WeChatOptions _weChatOptions;
|
private readonly WeChatOptions _weChatOptions;
|
||||||
|
|
||||||
|
|
||||||
@@ -75,8 +77,7 @@ namespace CoreCms.Net.Services
|
|||||||
, IServiceProvider serviceProvider, ICoreCmsServicesServices servicesServices
|
, IServiceProvider serviceProvider, ICoreCmsServicesServices servicesServices
|
||||||
, ICoreCmsUserServicesOrderServices userServicesOrderServices
|
, ICoreCmsUserServicesOrderServices userServicesOrderServices
|
||||||
, ICoreCmsUserWeChatInfoServices userWeChatInfoServices
|
, ICoreCmsUserWeChatInfoServices userWeChatInfoServices
|
||||||
, IOptions<WeChatOptions> weChatOptions
|
, IOptions<WeChatOptions> weChatOptions, ICoreCmsTopUpTypeServices topUpTypeServices, ICoreCmsUserPointLogServices userPointLogServices)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
this._dal = dal;
|
this._dal = dal;
|
||||||
base.BaseDal = dal;
|
base.BaseDal = dal;
|
||||||
@@ -94,6 +95,8 @@ namespace CoreCms.Net.Services
|
|||||||
_servicesServices = servicesServices;
|
_servicesServices = servicesServices;
|
||||||
_userServicesOrderServices = userServicesOrderServices;
|
_userServicesOrderServices = userServicesOrderServices;
|
||||||
_userWeChatInfoServices = userWeChatInfoServices;
|
_userWeChatInfoServices = userWeChatInfoServices;
|
||||||
|
_topUpTypeServices = topUpTypeServices;
|
||||||
|
_userPointLogServices = userPointLogServices;
|
||||||
_weChatOptions = weChatOptions.Value;
|
_weChatOptions = weChatOptions.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,9 +155,17 @@ namespace CoreCms.Net.Services
|
|||||||
//充值
|
//充值
|
||||||
else if (type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
else if (type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
||||||
{
|
{
|
||||||
if (@params != null && @params.ContainsKey("money"))
|
var typeId = Convert.ToInt16(orderId);
|
||||||
|
var typeModel = await _topUpTypeServices.QueryByClauseAsync(p => p.id == typeId, true);
|
||||||
|
|
||||||
|
if (typeModel != null)
|
||||||
{
|
{
|
||||||
dto.money = @params["money"].ObjectToDecimal(0); //充值金额
|
dto.rel.Add(new Rel()
|
||||||
|
{
|
||||||
|
sourceId = orderId,
|
||||||
|
money = typeModel.defaultMoney
|
||||||
|
});
|
||||||
|
dto.money += typeModel.defaultMoney;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -162,11 +173,7 @@ namespace CoreCms.Net.Services
|
|||||||
jm.msg = "请输入正确的充值金额";
|
jm.msg = "请输入正确的充值金额";
|
||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
dto.rel.Add(new Rel()
|
|
||||||
{
|
|
||||||
sourceId = orderId,
|
|
||||||
money = dto.money
|
|
||||||
});
|
|
||||||
jm.status = true;
|
jm.status = true;
|
||||||
jm.data = dto;
|
jm.data = dto;
|
||||||
}
|
}
|
||||||
@@ -310,23 +317,27 @@ namespace CoreCms.Net.Services
|
|||||||
//充值
|
//充值
|
||||||
else if (type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
else if (type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
||||||
{
|
{
|
||||||
if (@params != null && @params.ContainsKey("money"))
|
|
||||||
{
|
|
||||||
dto.money = @params["money"].ObjectToDecimal(0); //充值金额
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jm.status = false;
|
|
||||||
jm.msg = "请输入正确的充值金额";
|
|
||||||
return jm;
|
|
||||||
}
|
|
||||||
foreach (var item in sourceStr)
|
foreach (var item in sourceStr)
|
||||||
{
|
{
|
||||||
dto.rel.Add(new Rel()
|
var typeId = Convert.ToInt16(item);
|
||||||
|
var typeModel = await _topUpTypeServices.QueryByClauseAsync(p => p.id == typeId, true);
|
||||||
|
|
||||||
|
if (typeModel != null)
|
||||||
{
|
{
|
||||||
sourceId = item,
|
dto.rel.Add(new Rel()
|
||||||
money = dto.money
|
{
|
||||||
});
|
sourceId = item,
|
||||||
|
money = typeModel.defaultMoney
|
||||||
|
});
|
||||||
|
dto.money += typeModel.defaultMoney;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "请输入正确的充值金额";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
jm.status = true;
|
jm.status = true;
|
||||||
jm.data = dto;
|
jm.data = dto;
|
||||||
@@ -425,7 +436,7 @@ namespace CoreCms.Net.Services
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 支付,先生成支付单,然后去支付
|
/// 支付,先生成支付单,然后去支付
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sourceStr">来源,一般是订单号或者用户id,比如充值</param>
|
/// <param name="sourceStr">来源,一般是订单号或者用户id</param>
|
||||||
/// <param name="paymentCode">支付方式</param>
|
/// <param name="paymentCode">支付方式</param>
|
||||||
/// <param name="userId">用户序列</param>
|
/// <param name="userId">用户序列</param>
|
||||||
/// <param name="type">订单/充值/服务订单</param>
|
/// <param name="type">订单/充值/服务订单</param>
|
||||||
@@ -443,10 +454,10 @@ namespace CoreCms.Net.Services
|
|||||||
var jm = new WebApiCallBack();
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
//如果支付类型为余额充值,那么资源ID就是用户ID
|
//如果支付类型为余额充值,那么资源ID就是用户ID
|
||||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
//if (type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
||||||
{
|
//{
|
||||||
sourceStr = userId.ToString();
|
// sourceStr = userId.ToString();
|
||||||
}
|
//}
|
||||||
//判断支付方式是否开启
|
//判断支付方式是否开启
|
||||||
var paymentInfo = await _paymentsServices.QueryByClauseAsync(p => p.code == paymentCode && p.isEnable == true);
|
var paymentInfo = await _paymentsServices.QueryByClauseAsync(p => p.code == paymentCode && p.isEnable == true);
|
||||||
if (paymentInfo == null)
|
if (paymentInfo == null)
|
||||||
@@ -611,6 +622,12 @@ namespace CoreCms.Net.Services
|
|||||||
|
|
||||||
jm.data = jm.code = 10059;
|
jm.data = jm.code = 10059;
|
||||||
jm.msg = GlobalErrorCodeVars.Code10059;
|
jm.msg = GlobalErrorCodeVars.Code10059;
|
||||||
|
jm.otherData = new
|
||||||
|
{
|
||||||
|
sourceStrArr,
|
||||||
|
sourceStr,
|
||||||
|
paymentRelData
|
||||||
|
};
|
||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
//取支付标题,就不往数据库里存了吧
|
//取支付标题,就不往数据库里存了吧
|
||||||
@@ -679,8 +696,20 @@ namespace CoreCms.Net.Services
|
|||||||
else if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
else if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Recharge)
|
||||||
{
|
{
|
||||||
//给用户做充值
|
//给用户做充值
|
||||||
var userId = billPaymentInfo.sourceId.ObjectToInt(0);
|
var topUpTypeId = billPaymentInfo.sourceId.ObjectToInt(0);
|
||||||
await _userBalanceServices.Change(userId, (int)GlobalEnumVars.UserBalanceSourceTypes.Recharge, billPaymentInfo.money, billPaymentInfo.paymentId);
|
|
||||||
|
var topUpTypeModel = await _topUpTypeServices.QueryByClauseAsync(p => p.id == topUpTypeId, true);
|
||||||
|
if (topUpTypeModel != null)
|
||||||
|
{
|
||||||
|
var topUpMoney = topUpTypeModel.defaultMoney + topUpTypeModel.giftMoney;
|
||||||
|
await _userBalanceServices.Change(billPaymentInfo.userId, (int)GlobalEnumVars.UserBalanceSourceTypes.Recharge, topUpMoney, billPaymentInfo.paymentId);
|
||||||
|
|
||||||
|
if (topUpTypeModel.giftPoint > 0)
|
||||||
|
{
|
||||||
|
await _userPointLogServices.SetPoint(billPaymentInfo.userId, topUpTypeModel.giftPoint,
|
||||||
|
(int)GlobalEnumVars.UserPointSourceTypes.PointTypeTopUp, "充值赠送积分");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.ServiceOrder)
|
else if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.ServiceOrder)
|
||||||
{
|
{
|
||||||
|
|||||||
111
CoreCms.Net.Services/Shop/CoreCmsTopUpTypeServices.cs
Normal file
111
CoreCms.Net.Services/Shop/CoreCmsTopUpTypeServices.cs
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2023/3/20 21:20:30
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Configuration;
|
||||||
|
using CoreCms.Net.IRepository;
|
||||||
|
using CoreCms.Net.IRepository.UnitOfWork;
|
||||||
|
using CoreCms.Net.IServices;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 充值类型 接口实现
|
||||||
|
/// </summary>
|
||||||
|
public class CoreCmsTopUpTypeServices : BaseServices<CoreCmsTopUpType>, ICoreCmsTopUpTypeServices
|
||||||
|
{
|
||||||
|
private readonly ICoreCmsTopUpTypeRepository _dal;
|
||||||
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
|
|
||||||
|
public CoreCmsTopUpTypeServices(IUnitOfWork unitOfWork, ICoreCmsTopUpTypeRepository dal)
|
||||||
|
{
|
||||||
|
this._dal = dal;
|
||||||
|
base.BaseDal = dal;
|
||||||
|
_unitOfWork = unitOfWork;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 实现重写增删改查操作==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步插入方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">实体数据</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> InsertAsync(CoreCmsTopUpType entity)
|
||||||
|
{
|
||||||
|
return await _dal.InsertAsync(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写异步更新方法方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsTopUpType entity)
|
||||||
|
{
|
||||||
|
return await _dal.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写删除指定ID的数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||||
|
{
|
||||||
|
return await _dal.DeleteByIdAsync(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取缓存的所有数据==========================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取缓存的所有数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<CoreCmsTopUpType>> GetCaChe()
|
||||||
|
{
|
||||||
|
return await _dal.GetCaChe();
|
||||||
|
}
|
||||||
|
|
||||||
|
#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<CoreCmsTopUpType>> QueryPageAsync(Expression<Func<CoreCmsTopUpType, bool>> predicate,
|
||||||
|
Expression<Func<CoreCmsTopUpType, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||||
|
int pageSize = 20, bool blUseNoLock = false)
|
||||||
|
{
|
||||||
|
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -409,6 +409,12 @@ const install = (Vue, vm) => {
|
|||||||
let getLiveInfo = (params, config = {}) => http.post('/Api/LiveBroadCast/GetLiveInfo', params, { custom: { methodName: 'liveBroadCast.getLiveInfo', needToken: false } });
|
let getLiveInfo = (params, config = {}) => http.post('/Api/LiveBroadCast/GetLiveInfo', params, { custom: { methodName: 'liveBroadCast.getLiveInfo', needToken: false } });
|
||||||
|
|
||||||
|
|
||||||
|
//充值规则列表
|
||||||
|
let getTopUpTypeList = (params, config = {}) => http.post('/Api/TopUp/TypeList', params, { custom: { methodName: 'topUp.typeList', needToken: false } });
|
||||||
|
//获取单个充值规则
|
||||||
|
let getTypeDetail = (params, config = {}) => http.post('/Api/TopUp/getTypeDetail', params, { custom: { methodName: 'topUp.getTypeDetail', needToken: false } });
|
||||||
|
|
||||||
|
|
||||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||||
vm.$u.api = {
|
vm.$u.api = {
|
||||||
shopConfigV2,
|
shopConfigV2,
|
||||||
@@ -602,7 +608,10 @@ const install = (Vue, vm) => {
|
|||||||
getSolitairePageList,
|
getSolitairePageList,
|
||||||
getSolitaireDetail,
|
getSolitaireDetail,
|
||||||
|
|
||||||
getLiveInfo
|
getLiveInfo,
|
||||||
|
|
||||||
|
getTopUpTypeList,
|
||||||
|
getTypeDetail
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,40 @@
|
|||||||
<u-form-item label="当前金额" borderBottom>
|
<u-form-item label="当前金额" borderBottom>
|
||||||
<view class="coreshop-text-red coreshop-text-price coreshop-font-17">{{ user.balance || '0'}}</view>
|
<view class="coreshop-text-red coreshop-text-price coreshop-font-17">{{ user.balance || '0'}}</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="储值金额" prop="money">
|
<u-form-item label="储值金额" prop="form.money">
|
||||||
<u--input type="number" v-model="form.money" placeholder='请输入要储值的金额' />
|
<u--input type="number" v-model="form.money" disabled="true" placeholder='请输入要储值的金额' border="bottom" clearable />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u--form>
|
</u--form>
|
||||||
|
|
||||||
|
<view class="coreshop-flex coreshop-align-center coreshop-justify-center coreshop-padding-10">
|
||||||
|
请选择您的充值方案
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<u-grid :border="false" col="2">
|
||||||
|
<u-grid-item v-for="(item, key) in typeList" :key="key">
|
||||||
|
<view class="coreshop-padding-10 coreshop-percent-100">
|
||||||
|
<u-button type="error" :plain="item.plain" :text="item.title" @click="changeMoney(key)"></u-button>
|
||||||
|
</view>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="coreshop-font-13 coreshop-line-height-22 coreshop-margin-top-40">
|
||||||
|
<p>
|
||||||
|
充值须知:
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
1、充值金额永不过期;
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
2、充值一经办理,概不退款;
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
3、充值金额将无法用于提现;
|
||||||
|
</p>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!--按钮-->
|
<!--按钮-->
|
||||||
<view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom">
|
<view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom">
|
||||||
<u-button type="error" size="normal" @click="navigateToHandle">去支付</u-button>
|
<u-button type="error" size="normal" @click="navigateToHandle">去支付</u-button>
|
||||||
@@ -32,8 +62,10 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
user: {}, // 用户信息
|
user: {}, // 用户信息
|
||||||
|
typeList: [],
|
||||||
|
topUpTypeId: 0,
|
||||||
form: {
|
form: {
|
||||||
money: ''// 储值的金额
|
money: 0// 储值的金额
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
money: [
|
money: [
|
||||||
@@ -56,6 +88,7 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.userInfo()
|
this.userInfo()
|
||||||
|
this.getTopUpTypeList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
@@ -66,14 +99,47 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获取用户信息
|
||||||
|
getTopUpTypeList() {
|
||||||
|
this.$u.api.getTopUpTypeList().then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
for (var i = 0; i < res.data.length; i++) {
|
||||||
|
res.data[i].plain = i != 0;
|
||||||
|
if (i == 0) {
|
||||||
|
this.form.money = res.data[0].defaultMoney;
|
||||||
|
this.topUpTypeId = res.data[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.typeList = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeMoney(key) {
|
||||||
|
for (var i = 0; i < this.typeList.length; i++) {
|
||||||
|
if (key == i) {
|
||||||
|
this.typeList[i].plain = false;
|
||||||
|
this.form.money = this.typeList[i].defaultMoney;
|
||||||
|
this.topUpTypeId = this.typeList[i].id;
|
||||||
|
} else {
|
||||||
|
this.typeList[i].plain = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$refs.uForm.validateField('form.money')
|
||||||
|
console.log(key);
|
||||||
|
console.log(this.topUpTypeId);
|
||||||
|
},
|
||||||
// 去储值
|
// 去储值
|
||||||
navigateToHandle() {
|
navigateToHandle() {
|
||||||
this.$refs.uForm.validate().then(res => {
|
this.$refs.uForm.validate().then(res => {
|
||||||
console.log('验证通过');
|
console.log('验证通过');
|
||||||
|
if (this.topUpTypeId <= 0) {
|
||||||
|
this.$u.toast('请选择您要储值的方案。')
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!Number(this.form.money)) {
|
if (!Number(this.form.money)) {
|
||||||
this.$u.toast('请输入要储值的金额')
|
this.$u.toast('请选择您要储值的方案。')
|
||||||
} else {
|
} else {
|
||||||
this.$u.route('/pages/payment/pay/pay?recharge=' + Number(this.form.money) + '&type=' + this.orderType)
|
this.$u.route('/pages/payment/pay/pay?recharge=' + Number(this.topUpTypeId) + '&type=' + this.orderType)
|
||||||
}
|
}
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
uni.$u.toast('提交的数据校验失败,请输入合法信息!')
|
uni.$u.toast('提交的数据校验失败,请输入合法信息!')
|
||||||
|
|||||||
@@ -127,10 +127,11 @@
|
|||||||
trade_type: 'APP',
|
trade_type: 'APP',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data['ids'] = (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.seckill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent || this.type == this.$globalConstVars.paymentType.serviceOrder) ? this.orderId : this.uid
|
data.ids = (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.seckill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent || this.type == this.$globalConstVars.paymentType.serviceOrder) ? this.orderId : this.uid
|
||||||
|
|
||||||
// 判断订单支付类型
|
// 判断订单支付类型
|
||||||
if (this.type == this.$globalConstVars.paymentType.recharge && this.recharge) {
|
if (this.type == this.$globalConstVars.paymentType.recharge && this.recharge) {
|
||||||
|
data.ids = this.recharge;
|
||||||
data.params.money = this.recharge;
|
data.params.money = this.recharge;
|
||||||
} else if ((this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder) && this.recharge) {
|
} else if ((this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder) && this.recharge) {
|
||||||
data.ids = this.orderId;
|
data.ids = this.orderId;
|
||||||
|
|||||||
@@ -137,17 +137,14 @@
|
|||||||
//trade_type: 'NATIVE',
|
//trade_type: 'NATIVE',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data['ids'] = (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.seckill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent || this.type == this.$globalConstVars.paymentType.serviceOrder) ? this.orderId : this.uid
|
data.ids = (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.seckill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent || this.type == this.$globalConstVars.paymentType.serviceOrder) ? this.orderId : this.uid
|
||||||
|
|
||||||
// 判断订单支付类型
|
// 判断订单支付类型
|
||||||
if (this.type == this.$globalConstVars.paymentType.recharge && this.recharge) {
|
if (this.type == this.$globalConstVars.paymentType.recharge && this.recharge) {
|
||||||
data['params'] = {
|
data.ids = this.recharge;
|
||||||
money: this.recharge
|
data.params.money = this.recharge;
|
||||||
}
|
|
||||||
} else if ((this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder) && this.recharge) {
|
} else if ((this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder) && this.recharge) {
|
||||||
data['ids'] = this.orderId;
|
data.ids = this.orderId;
|
||||||
data['params'] = {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let _this = this
|
let _this = this
|
||||||
switch (code) {
|
switch (code) {
|
||||||
@@ -164,7 +161,7 @@
|
|||||||
signType: res.data.paymentParameters.signType,
|
signType: res.data.paymentParameters.signType,
|
||||||
paySign: res.data.paymentParameters.paySign,
|
paySign: res.data.paymentParameters.paySign,
|
||||||
success: function (e) {
|
success: function (e) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (e.errMsg === 'requestOrderPayment:ok') {
|
if (e.errMsg === 'requestOrderPayment:ok') {
|
||||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,10 +48,34 @@
|
|||||||
<template v-else-if="type == $globalConstVars.paymentType.recharge">
|
<template v-else-if="type == $globalConstVars.paymentType.recharge">
|
||||||
<view class="coreshop-list-item">
|
<view class="coreshop-list-item">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<text class="coreshop-text-grey">充值金额</text>
|
<text class="coreshop-text-grey">充值规则</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="action">
|
<view class="action">
|
||||||
<text class="coreshop-text-price coreshop-text-red coreshop-font-lg">{{ recharge || '' }}</text>
|
<text class="coreshop-font-sm coreshop-text-gray">{{ topUpType.title }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-list-item">
|
||||||
|
<view class="content">
|
||||||
|
<text class="coreshop-text-grey">支付金额</text>
|
||||||
|
</view>
|
||||||
|
<view class="action">
|
||||||
|
<text class="coreshop-text-price coreshop-text-red coreshop-font-lg">{{ topUpType.defaultMoney }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-list-item" v-if="topUpType.giftMoney>0">
|
||||||
|
<view class="content">
|
||||||
|
<text class="coreshop-text-grey">赠送金额</text>
|
||||||
|
</view>
|
||||||
|
<view class="action">
|
||||||
|
<text class="coreshop-text-price coreshop-text-gray coreshop-font-lg">{{ topUpType.giftMoney }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-list-item" v-if="topUpType.giftPoint>0">
|
||||||
|
<view class="content">
|
||||||
|
<text class="coreshop-font-sm coreshop-text-gray">赠送积分</text>
|
||||||
|
</view>
|
||||||
|
<view class="action">
|
||||||
|
<text class="coreshop-font-sm coreshop-text-gray">{{ topUpType.giftPoint }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -137,6 +161,7 @@
|
|||||||
orderInfo: {}, // 订单详情
|
orderInfo: {}, // 订单详情
|
||||||
userInfo: {}, // 用户信息
|
userInfo: {}, // 用户信息
|
||||||
serviceInfo: {}, // 服务信息
|
serviceInfo: {}, // 服务信息
|
||||||
|
topUpType: {}, // 充值类型信息
|
||||||
formId: 0,
|
formId: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -161,11 +186,14 @@
|
|||||||
this.type = Number(options.type);
|
this.type = Number(options.type);
|
||||||
this.formId = Number(options.formId);
|
this.formId = Number(options.formId);
|
||||||
|
|
||||||
|
console.log(this.recharge);
|
||||||
|
|
||||||
if (this.orderId && (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.seckill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent)) {
|
if (this.orderId && (this.type == this.$globalConstVars.paymentType.common || this.type == this.$globalConstVars.paymentType.pinTuan || this.type == this.$globalConstVars.paymentType.group || this.type == this.$globalConstVars.paymentType.seckill || this.type == this.$globalConstVars.paymentType.bargain || this.type == this.$globalConstVars.paymentType.giveaway || this.type == this.$globalConstVars.paymentType.solitaire || this.type == this.$globalConstVars.paymentType.transactionComponent)) {
|
||||||
// 商品订单
|
// 商品订单
|
||||||
this.getOrderInfo();
|
this.getOrderInfo();
|
||||||
} else if (this.recharge && this.type == this.$globalConstVars.paymentType.recharge) {
|
} else if (this.recharge > 0 && this.type == this.$globalConstVars.paymentType.recharge) {
|
||||||
// 充值订单 获取用户id
|
// 充值订单 获取用户id
|
||||||
|
this.getTypeDetail();
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
} else if (this.formId && (this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder)) {
|
} else if (this.formId && (this.type == this.$globalConstVars.paymentType.formPay || this.type == this.$globalConstVars.paymentType.formOrder)) {
|
||||||
// 表单订单 id传到订单上
|
// 表单订单 id传到订单上
|
||||||
@@ -209,6 +237,19 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//获取单个充值规则
|
||||||
|
getTypeDetail() {
|
||||||
|
let data = {
|
||||||
|
id: this.recharge
|
||||||
|
};
|
||||||
|
this.$u.api.getTypeDetail(data).then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
this.topUpType = res.data;
|
||||||
|
} else {
|
||||||
|
this.$u.toast(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
this.$u.api.userInfo().then(res => {
|
this.$u.api.userInfo().then(res => {
|
||||||
|
|||||||
@@ -0,0 +1,329 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
* Project: CoreCms
|
||||||
|
* ProjectName: 核心内容管理系统
|
||||||
|
* Web: https://www.corecms.net
|
||||||
|
* Author: 大灰灰
|
||||||
|
* Email: jianweie@163.com
|
||||||
|
* CreateTime: 2023/3/20 21:20:30
|
||||||
|
* Description: 暂无
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CoreCms.Net.Configuration;
|
||||||
|
using CoreCms.Net.Model.Entities;
|
||||||
|
using CoreCms.Net.Model.Entities.Expression;
|
||||||
|
using CoreCms.Net.Model.FromBody;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using CoreCms.Net.Filter;
|
||||||
|
using CoreCms.Net.Loging;
|
||||||
|
using CoreCms.Net.IServices;
|
||||||
|
using CoreCms.Net.Utility.Helper;
|
||||||
|
using CoreCms.Net.Utility.Extensions;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.HSSF.UserModel;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Web.Admin.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 充值类型
|
||||||
|
///</summary>
|
||||||
|
[Description("充值类型")]
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
[RequiredErrorForAdmin]
|
||||||
|
[Authorize(Permissions.Name)]
|
||||||
|
public class CoreCmsTopUpTypeController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||||
|
private readonly ICoreCmsTopUpTypeServices _coreCmsTopUpTypeServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
///</summary>
|
||||||
|
public CoreCmsTopUpTypeController(IWebHostEnvironment webHostEnvironment
|
||||||
|
, ICoreCmsTopUpTypeServices coreCmsTopUpTypeServices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_webHostEnvironment = webHostEnvironment;
|
||||||
|
_coreCmsTopUpTypeServices = coreCmsTopUpTypeServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 获取列表============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/GetPageList
|
||||||
|
/// <summary>
|
||||||
|
/// 获取列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("获取列表")]
|
||||||
|
public async Task<AdminUiCallBack> GetPageList()
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||||
|
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||||
|
var where = PredicateBuilder.True<CoreCmsTopUpType>();
|
||||||
|
//获取排序字段
|
||||||
|
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||||
|
|
||||||
|
Expression<Func<CoreCmsTopUpType, object>> orderEx = orderField switch
|
||||||
|
{
|
||||||
|
"id" => p => p.id,
|
||||||
|
"title" => p => p.title,
|
||||||
|
"defaultMoney" => p => p.defaultMoney,
|
||||||
|
"giftMoney" => p => p.giftMoney,
|
||||||
|
"giftPoint" => p => p.giftPoint,
|
||||||
|
"sortId" => p => p.sortId,
|
||||||
|
"isEnable" => p => p.isEnable,
|
||||||
|
_ => p => p.sortId
|
||||||
|
};
|
||||||
|
|
||||||
|
//设置排序方式
|
||||||
|
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||||
|
var orderBy = orderDirection switch
|
||||||
|
{
|
||||||
|
"asc" => OrderByType.Asc,
|
||||||
|
"desc" => OrderByType.Desc,
|
||||||
|
_ => OrderByType.Desc
|
||||||
|
};
|
||||||
|
//查询筛选
|
||||||
|
|
||||||
|
//序列 int
|
||||||
|
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (id > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.id == id);
|
||||||
|
}
|
||||||
|
//标题 nvarchar
|
||||||
|
var title = Request.Form["title"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(title))
|
||||||
|
{
|
||||||
|
where = where.And(p => p.title.Contains(title));
|
||||||
|
}
|
||||||
|
//充值金额 int
|
||||||
|
var defaultMoney = Request.Form["defaultMoney"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (defaultMoney > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.defaultMoney == defaultMoney);
|
||||||
|
}
|
||||||
|
//赠送金额 int
|
||||||
|
var giftMoney = Request.Form["giftMoney"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (giftMoney > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.giftMoney == giftMoney);
|
||||||
|
}
|
||||||
|
//赠送积分 int
|
||||||
|
var giftPoint = Request.Form["giftPoint"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (giftPoint > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.giftPoint == giftPoint);
|
||||||
|
}
|
||||||
|
//显示排序 int
|
||||||
|
var sortId = Request.Form["sortId"].FirstOrDefault().ObjectToInt(0);
|
||||||
|
if (sortId > 0)
|
||||||
|
{
|
||||||
|
where = where.And(p => p.sortId == sortId);
|
||||||
|
}
|
||||||
|
//是否启用 bit
|
||||||
|
var isEnable = Request.Form["isEnable"].FirstOrDefault();
|
||||||
|
if (!string.IsNullOrEmpty(isEnable) && isEnable.ToLowerInvariant() == "true")
|
||||||
|
{
|
||||||
|
where = where.And(p => p.isEnable == true);
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrEmpty(isEnable) && isEnable.ToLowerInvariant() == "false")
|
||||||
|
{
|
||||||
|
where = where.And(p => p.isEnable == false);
|
||||||
|
}
|
||||||
|
//获取数据
|
||||||
|
var list = await _coreCmsTopUpTypeServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||||
|
//返回数据
|
||||||
|
jm.data = list;
|
||||||
|
jm.code = 0;
|
||||||
|
jm.count = list.TotalCount;
|
||||||
|
jm.msg = "数据调用成功!";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 首页数据============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/GetIndex
|
||||||
|
/// <summary>
|
||||||
|
/// 首页数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("首页数据")]
|
||||||
|
public AdminUiCallBack GetIndex()
|
||||||
|
{
|
||||||
|
//返回数据
|
||||||
|
var jm = new AdminUiCallBack { code = 0 };
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 创建数据============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/GetCreate
|
||||||
|
/// <summary>
|
||||||
|
/// 创建数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("创建数据")]
|
||||||
|
public AdminUiCallBack GetCreate()
|
||||||
|
{
|
||||||
|
//返回数据
|
||||||
|
var jm = new AdminUiCallBack { code = 0 };
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 创建提交============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/DoCreate
|
||||||
|
/// <summary>
|
||||||
|
/// 创建提交
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("创建提交")]
|
||||||
|
public async Task<AdminUiCallBack> DoCreate([FromBody] CoreCmsTopUpType entity)
|
||||||
|
{
|
||||||
|
var jm = await _coreCmsTopUpTypeServices.InsertAsync(entity);
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 编辑数据============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/GetEdit
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("编辑数据")]
|
||||||
|
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var model = await _coreCmsTopUpTypeServices.QueryByIdAsync(entity.id, false);
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
jm.code = 0;
|
||||||
|
jm.data = model;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 编辑提交============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/Edit
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑提交
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("编辑提交")]
|
||||||
|
public async Task<AdminUiCallBack> DoEdit([FromBody] CoreCmsTopUpType entity)
|
||||||
|
{
|
||||||
|
var jm = await _coreCmsTopUpTypeServices.UpdateAsync(entity);
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 删除数据============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/DoDelete/10
|
||||||
|
/// <summary>
|
||||||
|
/// 单选删除
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("单选删除")]
|
||||||
|
public async Task<AdminUiCallBack> DoDelete([FromBody] FMIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var model = await _coreCmsTopUpTypeServices.ExistsAsync(p => p.id == entity.id, true);
|
||||||
|
if (!model)
|
||||||
|
{
|
||||||
|
jm.msg = GlobalConstVars.DataisNo;
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
jm = await _coreCmsTopUpTypeServices.DeleteByIdAsync(entity.id);
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 预览数据============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/GetDetails/10
|
||||||
|
/// <summary>
|
||||||
|
/// 预览数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("预览数据")]
|
||||||
|
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var model = await _coreCmsTopUpTypeServices.QueryByIdAsync(entity.id, false);
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
jm.code = 0;
|
||||||
|
jm.data = model;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 设置是否启用============================================================
|
||||||
|
// POST: Api/CoreCmsTopUpType/DoSetisEnable/10
|
||||||
|
/// <summary>
|
||||||
|
/// 设置是否启用
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Description("设置是否启用")]
|
||||||
|
public async Task<AdminUiCallBack> DoSetisEnable([FromBody] FMUpdateBoolDataByIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new AdminUiCallBack();
|
||||||
|
|
||||||
|
var oldModel = await _coreCmsTopUpTypeServices.QueryByIdAsync(entity.id, false);
|
||||||
|
if (oldModel == null)
|
||||||
|
{
|
||||||
|
jm.msg = "不存在此信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
oldModel.isEnable = (bool)entity.data;
|
||||||
|
|
||||||
|
var bl = await _coreCmsTopUpTypeServices.UpdateAsync(p => new CoreCmsTopUpType() { isEnable = oldModel.isEnable }, p => p.id == oldModel.id);
|
||||||
|
jm.code = bl ? 0 : 1;
|
||||||
|
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3975,6 +3975,76 @@
|
|||||||
<param name="entity"></param>
|
<param name="entity"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController">
|
||||||
|
<summary>
|
||||||
|
充值类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsTopUpTypeServices)">
|
||||||
|
<summary>
|
||||||
|
构造函数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.GetPageList">
|
||||||
|
<summary>
|
||||||
|
获取列表
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.GetIndex">
|
||||||
|
<summary>
|
||||||
|
首页数据
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.GetCreate">
|
||||||
|
<summary>
|
||||||
|
创建数据
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.DoCreate(CoreCms.Net.Model.Entities.CoreCmsTopUpType)">
|
||||||
|
<summary>
|
||||||
|
创建提交
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.GetEdit(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||||
|
<summary>
|
||||||
|
编辑数据
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.DoEdit(CoreCms.Net.Model.Entities.CoreCmsTopUpType)">
|
||||||
|
<summary>
|
||||||
|
编辑提交
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.DoDelete(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||||
|
<summary>
|
||||||
|
单选删除
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.GetDetails(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||||
|
<summary>
|
||||||
|
预览数据
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsTopUpTypeController.DoSetisEnable(CoreCms.Net.Model.FromBody.FMUpdateBoolDataByIntId)">
|
||||||
|
<summary>
|
||||||
|
设置是否启用
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsSolitaireController">
|
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsSolitaireController">
|
||||||
<summary>
|
<summary>
|
||||||
接龙活动表
|
接龙活动表
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||||
|
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsTopUpType-createForm" id="LAY-app-CoreCmsTopUpType-createForm">
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="title" class="layui-form-label layui-form-required">标题</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input name="title" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" lay-reqText="请输入标题" placeholder="请输入标题" />
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">如冲100送100,或者100这样</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="title" class="layui-form-label layui-form-required">说明</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input name="description" lay-verType="tips" class="layui-input" placeholder="请输入说明" lay-reqText="请输入说明" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="defaultMoney" class="layui-form-label layui-form-required">充值金额</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="number" min="0" max="999999" name="defaultMoney" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入充值金额" lay-reqText="请输入充值金额并为数字" />
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">充值具体需要支付的金额</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="giftMoney" class="layui-form-label layui-form-required">赠送金额</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="number" min="0" max="999999" name="giftMoney" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入赠送金额" lay-reqText="请输入赠送金额并为数字" />
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">充值支付后,实际到账赠送的金额</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="giftPoint" class="layui-form-label layui-form-required">赠送积分</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="number" min="0" max="999999" name="giftPoint" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入赠送积分" lay-reqText="请输入赠送积分并为数字" />
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">充值支付后,实际到账赠送的积分</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="sortId" class="layui-form-label layui-form-required">显示排序</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="number" min="0" max="999999" name="sortId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入显示排序" lay-reqText="请输入显示排序并为数字" />
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">从小到大在前端显示</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="isEnable" class="layui-form-label layui-form-required">是否启用</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="checkbox" lay-filter="switch" name="isEnable" lay-skin="switch" lay-text="开启|关闭">
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">只有设置为开启才会在前端显示</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item text-right core-hidden">
|
||||||
|
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsTopUpType-createForm-submit" id="LAY-app-CoreCmsTopUpType-createForm-submit" value="确认添加">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
var debug = layui.setter.debug;
|
||||||
|
layui.data.done = function (d) {
|
||||||
|
//开启调试情况下获取接口赋值数据
|
||||||
|
if (debug) { console.log(d.params.data); }
|
||||||
|
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
|
||||||
|
function () {
|
||||||
|
var $ = layui.$
|
||||||
|
, form = layui.form
|
||||||
|
, admin = layui.admin
|
||||||
|
, laydate = layui.laydate
|
||||||
|
, upload = layui.upload
|
||||||
|
, cropperImg = layui.cropperImg
|
||||||
|
, coreHelper = layui.coreHelper;
|
||||||
|
|
||||||
|
form.verify({
|
||||||
|
|
||||||
|
verifytitle: [/^.{0,50}$/, '标题最大只允许输入50位字符'],
|
||||||
|
});
|
||||||
|
//重载form
|
||||||
|
form.render(null, 'LAY-app-CoreCmsTopUpType-createForm');
|
||||||
|
})
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||||
|
<table class="layui-table layui-form" lay-filter="LAY-app-CoreCmsTopUpType-detailsForm" id="LAY-app-CoreCmsTopUpType-detailsForm">
|
||||||
|
<colgroup>
|
||||||
|
<col width="100">
|
||||||
|
<col>
|
||||||
|
</colgroup>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="id">序列</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.id || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="title">标题</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.title || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="defaultMoney">充值金额</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.defaultMoney || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="giftMoney">赠送金额</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.giftMoney || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="giftPoint">赠送积分</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.giftPoint || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="sortId">显示排序</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ d.params.data.sortId || '' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="isEnable">是否启用</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" disabled name="isEnable" value="{{d.params.data.isEnable}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isEnable" {{ d.params.data.isEnable ? 'checked' : '' }}>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
var debug= layui.setter.debug;
|
||||||
|
layui.data.done = function (d) {
|
||||||
|
//开启调试情况下获取接口赋值数据
|
||||||
|
if (debug) { console.log(d.params.data); }
|
||||||
|
|
||||||
|
layui.use(['admin', 'form', 'coreHelper'], function () {
|
||||||
|
var $ = layui.$
|
||||||
|
, setter = layui.setter
|
||||||
|
, admin = layui.admin
|
||||||
|
, coreHelper = layui.coreHelper
|
||||||
|
, form = layui.form;
|
||||||
|
form.render(null, 'LAY-app-CoreCmsTopUpType-detailsForm');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<script type="text/html" template lay-done="layui.data.sendParams(d);">
|
||||||
|
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsTopUpType-editForm" id="LAY-app-CoreCmsTopUpType-editForm">
|
||||||
|
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="title" class="layui-form-label layui-form-required">标题</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input name="title" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" placeholder="请输入标题" lay-reqText="请输入标题" value="{{d.params.data.title || '' }}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="title" class="layui-form-label layui-form-required">说明</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input name="description" lay-verType="tips" class="layui-input" placeholder="请输入说明" lay-reqText="请输入说明" value="{{d.params.data.description || '' }}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="defaultMoney" class="layui-form-label layui-form-required">充值金额</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="number" min="0" max="999999" name="defaultMoney" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.defaultMoney || '0' }}" placeholder="请输入充值金额" lay-reqText="请输入充值金额并为数字" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="giftMoney" class="layui-form-label layui-form-required">赠送金额</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="number" min="0" max="999999" name="giftMoney" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.giftMoney || '0' }}" placeholder="请输入赠送金额" lay-reqText="请输入赠送金额并为数字" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="giftPoint" class="layui-form-label layui-form-required">赠送积分</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="number" min="0" max="999999" name="giftPoint" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.giftPoint || '0' }}" placeholder="请输入赠送积分" lay-reqText="请输入赠送积分并为数字" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label for="sortId" class="layui-form-label layui-form-required">显示排序</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="number" min="0" max="999999" name="sortId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.sortId || '0' }}" placeholder="请输入显示排序" lay-reqText="请输入显示排序并为数字" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item" pane>
|
||||||
|
<label for="isEnable" class="layui-form-label layui-form-required">是否启用</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="checkbox" lay-filter="switch" name="isEnable" {{ d.params.data.isEnable ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="layui-form-item text-right core-hidden">
|
||||||
|
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsTopUpType-editForm-submit" id="LAY-app-CoreCmsTopUpType-editForm-submit" value="确认编辑">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
var debug= layui.setter.debug;
|
||||||
|
layui.data.sendParams = function (d) {
|
||||||
|
//开启调试情况下获取接口赋值数据
|
||||||
|
if (debug) { console.log(d.params.data); }
|
||||||
|
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
|
||||||
|
function () {
|
||||||
|
var $ = layui.$
|
||||||
|
, form = layui.form
|
||||||
|
, admin = layui.admin
|
||||||
|
, laydate = layui.laydate
|
||||||
|
, upload = layui.upload
|
||||||
|
, cropperImg = layui.cropperImg
|
||||||
|
, coreHelper = layui.coreHelper;
|
||||||
|
|
||||||
|
form.verify({
|
||||||
|
|
||||||
|
verifytitle: [/^.{0,50}$/,'标题最大只允许输入50位字符'],
|
||||||
|
});
|
||||||
|
//重载form
|
||||||
|
form.render(null, 'LAY-app-CoreCmsTopUpType-editForm');
|
||||||
|
})
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,328 @@
|
|||||||
|
<title>充值类型</title>
|
||||||
|
<!--当前位置开始-->
|
||||||
|
<div class="layui-card layadmin-header">
|
||||||
|
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||||
|
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--当前位置结束-->
|
||||||
|
<style>
|
||||||
|
/* 重写样式 */
|
||||||
|
</style>
|
||||||
|
<script type="text/html" template lay-type="Post" lay-url="Api/CoreCmsTopUpType/GetIndex" lay-done="layui.data.done(d);">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<div class="table-body">
|
||||||
|
<table id="LAY-app-CoreCmsTopUpType-tableBox" lay-filter="LAY-app-CoreCmsTopUpType-tableBox"></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/html" id="LAY-app-CoreCmsTopUpType-toolbar">
|
||||||
|
<div class="layui-form coreshop-toolbar-search-form">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label" for="title">标题</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="title" placeholder="请输入标题" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label" for="isEnable">是否启用</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<select name="isEnable">
|
||||||
|
<option value="">请选择</option>
|
||||||
|
<option value="True">是</option>
|
||||||
|
<option value="False">否</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsTopUpType-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="LAY-app-CoreCmsTopUpType-pagebar">
|
||||||
|
<div class="layui-btn-container">
|
||||||
|
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="LAY-app-CoreCmsTopUpType-tableBox-bar">
|
||||||
|
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
|
||||||
|
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||||
|
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsTopUpTypeTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
|
||||||
|
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsTopUpTypeTbDelDrop{{d.LAY_INDEX}}"
|
||||||
|
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
|
||||||
|
<div class="dropdown-anchor"></div>
|
||||||
|
<div class="dropdown-popconfirm-title">
|
||||||
|
<i class="layui-icon layui-icon-help"></i>
|
||||||
|
确定要删除吗?
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-popconfirm-btn">
|
||||||
|
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
|
||||||
|
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var indexData;
|
||||||
|
var debug = layui.setter.debug;
|
||||||
|
layui.data.done = function (d) {
|
||||||
|
//开启调试情况下获取接口赋值数据
|
||||||
|
if (debug) { console.log(d); }
|
||||||
|
|
||||||
|
indexData = d.data;
|
||||||
|
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
|
||||||
|
function () {
|
||||||
|
var $ = layui.$
|
||||||
|
, admin = layui.admin
|
||||||
|
, table = layui.table
|
||||||
|
, form = layui.form
|
||||||
|
, laydate = layui.laydate
|
||||||
|
, setter = layui.setter
|
||||||
|
, coreHelper = layui.coreHelper
|
||||||
|
, util = layui.util
|
||||||
|
, view = layui.view;
|
||||||
|
|
||||||
|
var searchwhere;
|
||||||
|
//监听搜索
|
||||||
|
form.on('submit(LAY-app-CoreCmsTopUpType-search)',
|
||||||
|
function (data) {
|
||||||
|
var field = data.field;
|
||||||
|
searchwhere = field;
|
||||||
|
//执行重载
|
||||||
|
table.reloadData('LAY-app-CoreCmsTopUpType-tableBox', { where: field });
|
||||||
|
});
|
||||||
|
//数据绑定
|
||||||
|
table.render({
|
||||||
|
elem: '#LAY-app-CoreCmsTopUpType-tableBox',
|
||||||
|
url: layui.setter.apiUrl + 'Api/CoreCmsTopUpType/GetPageList',
|
||||||
|
method: 'POST',
|
||||||
|
toolbar: '#LAY-app-CoreCmsTopUpType-toolbar',
|
||||||
|
pagebar: '#LAY-app-CoreCmsTopUpType-pagebar',
|
||||||
|
className: 'pagebarbox',
|
||||||
|
defaultToolbar: ['filter', 'print', 'exports'],
|
||||||
|
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||||
|
page: true,
|
||||||
|
limit: 30,
|
||||||
|
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||||
|
text: { none: '暂无相关数据' },
|
||||||
|
cols: [
|
||||||
|
[
|
||||||
|
{ type: "checkbox", fixed: "left" },
|
||||||
|
{ field: 'id', title: '序列', width: 60, sort: false },
|
||||||
|
{ field: 'title', title: '标题', sort: false, width: 105 },
|
||||||
|
{ field: 'defaultMoney', title: '充值金额', sort: false, width: 105 },
|
||||||
|
{ field: 'giftMoney', title: '赠送金额', sort: false, width: 105 },
|
||||||
|
{ field: 'giftPoint', title: '赠送积分', sort: false, width: 105 },
|
||||||
|
{ field: 'sortId', title: '显示排序', sort: false, width: 105 },
|
||||||
|
{ field: 'isEnable', title: '是否启用', width: 95, templet: '#switch_isEnable', sort: false, unresize: true },
|
||||||
|
{ field: 'description', title: '说明', sort: false },
|
||||||
|
{ width: 162, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsTopUpType-tableBox-bar' }
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
//监听排序事件
|
||||||
|
table.on('sort(LAY-app-CoreCmsTopUpType-tableBox)', function (obj) {
|
||||||
|
table.reloadData('LAY-app-CoreCmsTopUpType-tableBox', {
|
||||||
|
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||||
|
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||||
|
orderField: obj.field, //排序字段
|
||||||
|
orderDirection: obj.type //排序方式
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//监听行双击事件
|
||||||
|
table.on('rowDouble(LAY-app-CoreCmsTopUpType-tableBox)', function (obj) {
|
||||||
|
//查看详情
|
||||||
|
doDetails(obj);
|
||||||
|
});
|
||||||
|
//头工具栏事件
|
||||||
|
table.on('pagebar(LAY-app-CoreCmsTopUpType-tableBox)', function (obj) {
|
||||||
|
var checkStatus = table.checkStatus(obj.config.id);
|
||||||
|
switch (obj.event) {
|
||||||
|
case 'addData':
|
||||||
|
doCreate();
|
||||||
|
break;
|
||||||
|
case 'batchDelete':
|
||||||
|
doBatchDelete(checkStatus);
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
//监听工具条
|
||||||
|
table.on('tool(LAY-app-CoreCmsTopUpType-tableBox)',
|
||||||
|
function (obj) {
|
||||||
|
if (obj.event === 'detail') {
|
||||||
|
doDetails(obj);
|
||||||
|
} else if (obj.event === 'del') {
|
||||||
|
doDelete(obj);
|
||||||
|
} else if (obj.event === 'edit') {
|
||||||
|
doEdit(obj)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//执行创建操作
|
||||||
|
function doCreate() {
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/GetCreate", null, function (e) {
|
||||||
|
if (e.code === 0) {
|
||||||
|
admin.popup({
|
||||||
|
shadeClose: false,
|
||||||
|
title: '创建数据',
|
||||||
|
area: ['600px', '450px'],
|
||||||
|
id: 'LAY-popup-CoreCmsTopUpType-create',
|
||||||
|
success: function (layero, index) {
|
||||||
|
view(this.id).render('shop/topuptype/topuptype/create', { data: e.data }).done(function () {
|
||||||
|
//监听提交
|
||||||
|
form.on('submit(LAY-app-CoreCmsTopUpType-createForm-submit)',
|
||||||
|
function (data) {
|
||||||
|
var field = data.field; //获取提交的字段
|
||||||
|
|
||||||
|
field.isEnable = field.isEnable == 'on';
|
||||||
|
|
||||||
|
if (debug) { console.log(field); } //开启调试返回数据
|
||||||
|
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/DoCreate", field, function (e) {
|
||||||
|
console.log(e)
|
||||||
|
if (e.code === 0) {
|
||||||
|
layui.table.reloadData('LAY-app-CoreCmsTopUpType-tableBox'); //重载表格
|
||||||
|
layer.close(index); //再执行关闭
|
||||||
|
layer.msg(e.msg);
|
||||||
|
} else {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 禁止弹窗出现滚动条
|
||||||
|
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||||
|
}
|
||||||
|
, btn: ['确定', '取消']
|
||||||
|
, yes: function (index, layero) {
|
||||||
|
layero.contents().find("#LAY-app-CoreCmsTopUpType-createForm-submit").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//执行编辑操作
|
||||||
|
function doEdit(obj) {
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/GetEdit", { id: obj.data.id }, function (e) {
|
||||||
|
if (e.code === 0) {
|
||||||
|
admin.popup({
|
||||||
|
shadeClose: false,
|
||||||
|
title: '编辑数据',
|
||||||
|
area: ['600px', '450px'],
|
||||||
|
id: 'LAY-popup-CoreCmsTopUpType-edit',
|
||||||
|
success: function (layero, index) {
|
||||||
|
view(this.id).render('shop/topuptype/topuptype/edit', { data: e.data }).done(function () {
|
||||||
|
//监听提交
|
||||||
|
form.on('submit(LAY-app-CoreCmsTopUpType-editForm-submit)',
|
||||||
|
function (data) {
|
||||||
|
var field = data.field; //获取提交的字段
|
||||||
|
|
||||||
|
field.isEnable = field.isEnable == 'on';
|
||||||
|
|
||||||
|
if (debug) { console.log(field); } //开启调试返回数据
|
||||||
|
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/DoEdit", field, function (e) {
|
||||||
|
console.log(e)
|
||||||
|
if (e.code === 0) {
|
||||||
|
layui.table.reloadData('LAY-app-CoreCmsTopUpType-tableBox'); //重载表格
|
||||||
|
layer.close(index); //再执行关闭
|
||||||
|
layer.msg(e.msg);
|
||||||
|
} else {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
// 禁止弹窗出现滚动条
|
||||||
|
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||||
|
}
|
||||||
|
, btn: ['确定', '取消']
|
||||||
|
, yes: function (index, layero) {
|
||||||
|
layero.contents().find("#LAY-app-CoreCmsTopUpType-editForm-submit").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//执行预览操作
|
||||||
|
function doDetails(obj) {
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/GetDetails", { id: obj.data.id }, function (e) {
|
||||||
|
if (e.code === 0) {
|
||||||
|
admin.popup({
|
||||||
|
shadeClose: false,
|
||||||
|
title: '查看详情',
|
||||||
|
area: ['600px', '450px'],
|
||||||
|
id: 'LAY-popup-CoreCmsTopUpType-details',
|
||||||
|
success: function (layero, index) {
|
||||||
|
view(this.id).render('shop/topuptype/topuptype/details', { data: e.data }).done(function () {
|
||||||
|
form.render();
|
||||||
|
});
|
||||||
|
// 禁止弹窗出现滚动条
|
||||||
|
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//执行单个删除
|
||||||
|
function doDelete(obj) {
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/DoDelete", { id: obj.data.id }, function (e) {
|
||||||
|
if (debug) { console.log(e); } //开启调试返回数据
|
||||||
|
table.reloadData('LAY-app-CoreCmsTopUpType-tableBox');
|
||||||
|
layer.msg(e.msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//执行批量删除
|
||||||
|
function doBatchDelete(checkStatus) {
|
||||||
|
var checkData = checkStatus.data;
|
||||||
|
if (checkData.length === 0) {
|
||||||
|
return layer.msg('请选择要删除的数据');
|
||||||
|
}
|
||||||
|
layer.confirm('确定删除吗?删除后将无法恢复。',
|
||||||
|
function (index) {
|
||||||
|
var delidsStr = [];
|
||||||
|
layui.each(checkData,
|
||||||
|
function (index, item) {
|
||||||
|
delidsStr.push(item.id);
|
||||||
|
});
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/DoBatchDelete", { id: delidsStr }, function (e) {
|
||||||
|
if (debug) { console.log(e); } //开启调试返回数据
|
||||||
|
table.reloadData('LAY-app-CoreCmsTopUpType-tableBox');
|
||||||
|
layer.msg(e.msg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//监听 表格复选框操作
|
||||||
|
|
||||||
|
layui.form.on('switch(switch_isEnable)', function (obj) {
|
||||||
|
coreHelper.Post("Api/CoreCmsTopUpType/DoSetisEnable", { id: this.value, data: obj.elem.checked }, function (e) {
|
||||||
|
if (debug) { console.log(e); } //开启调试返回数据
|
||||||
|
//table.reloadData('LAY-app-CoreCmsTopUpType-tableBox');
|
||||||
|
layer.msg(e.msg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//重载form
|
||||||
|
form.render();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--设置是否启用-->
|
||||||
|
<script type="text/html" id="switch_isEnable">
|
||||||
|
<input type="checkbox" name="switch_isEnable" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isEnable" {{ d.isEnable ? 'checked' : '' }}>
|
||||||
|
</script>
|
||||||
|
|
||||||
77
CoreCms.Net.Web.WebApi/Controllers/TopUpController.cs
Normal file
77
CoreCms.Net.Web.WebApi/Controllers/TopUpController.cs
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
using CoreCms.Net.IServices;
|
||||||
|
using CoreCms.Net.Model.FromBody;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using SqlSugar;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CoreCms.Net.Web.WebApi.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 充值接口
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
public class TopUpController : ControllerBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly ICoreCmsTopUpTypeServices _topUpTypeServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="topUpTypeServices"></param>
|
||||||
|
public TopUpController(ICoreCmsTopUpTypeServices topUpTypeServices)
|
||||||
|
{
|
||||||
|
_topUpTypeServices = topUpTypeServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取充值规则列表
|
||||||
|
/// <summary>
|
||||||
|
/// 获取通知列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<WebApiCallBack> TypeList()
|
||||||
|
{
|
||||||
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
|
var list = await _topUpTypeServices.QueryListByClauseAsync(p => p.isEnable == true, p => p.sortId, OrderByType.Desc, true, true);
|
||||||
|
jm.status = true;
|
||||||
|
jm.data = list;
|
||||||
|
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取单个充值规则
|
||||||
|
/// <summary>
|
||||||
|
/// 获取单个充值规则
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<WebApiCallBack> GetTypeDetail([FromBody] FMIntId entity)
|
||||||
|
{
|
||||||
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
|
var model = await _topUpTypeServices.QueryByClauseAsync(p => p.id == entity.id, true, true);
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
jm.msg = "数据获取失败";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
jm.status = true;
|
||||||
|
jm.data = model;
|
||||||
|
return jm;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -992,6 +992,30 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:CoreCms.Net.Web.WebApi.Controllers.TopUpController">
|
||||||
|
<summary>
|
||||||
|
充值接口
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.TopUpController.#ctor(CoreCms.Net.IServices.ICoreCmsTopUpTypeServices)">
|
||||||
|
<summary>
|
||||||
|
构造函数
|
||||||
|
</summary>
|
||||||
|
<param name="topUpTypeServices"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.TopUpController.TypeList">
|
||||||
|
<summary>
|
||||||
|
获取通知列表
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.TopUpController.GetTypeDetail(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||||
|
<summary>
|
||||||
|
获取单个充值规则
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Web.WebApi.Controllers.UserController">
|
<member name="T:CoreCms.Net.Web.WebApi.Controllers.UserController">
|
||||||
<summary>
|
<summary>
|
||||||
用户操作事件
|
用户操作事件
|
||||||
|
|||||||
13
数据库/MySql/20230327/升级脚本/1、创建表.sql
Normal file
13
数据库/MySql/20230327/升级脚本/1、创建表.sql
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
create table if not exists CoreCmsTopUpType
|
||||||
|
(
|
||||||
|
id int auto_increment comment '序列'
|
||||||
|
primary key,
|
||||||
|
title varchar(50) not null comment '标题',
|
||||||
|
defaultMoney int default 0 not null comment '充值金额',
|
||||||
|
giftMoney int default 0 not null comment '赠送金额',
|
||||||
|
giftPoint int default 0 not null comment '赠送积分',
|
||||||
|
sortId int default 1 not null comment '显示排序',
|
||||||
|
isEnable bit default b'1' not null comment '是否启用',
|
||||||
|
description varchar(100) charset utf8 null comment '说明'
|
||||||
|
)
|
||||||
|
comment '充值类型';
|
||||||
4
数据库/MySql/20230327/升级脚本/2、插入示例数据.sql
Normal file
4
数据库/MySql/20230327/升级脚本/2、插入示例数据.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO coreshop.CoreCmsTopUpType (id, title, defaultMoney, giftMoney, giftPoint, sortId, isEnable, description) VALUES (1, '冲100送10', 100, 10, 0, 3, true, '冲100送10');
|
||||||
|
INSERT INTO coreshop.CoreCmsTopUpType (id, title, defaultMoney, giftMoney, giftPoint, sortId, isEnable, description) VALUES (2, '冲10元送5元', 1, 5, 7, 4, true, '冲10元送5元');
|
||||||
|
INSERT INTO coreshop.CoreCmsTopUpType (id, title, defaultMoney, giftMoney, giftPoint, sortId, isEnable, description) VALUES (3, '冲500送50', 500, 50, 0, 2, true, '冲500送50');
|
||||||
|
INSERT INTO coreshop.CoreCmsTopUpType (id, title, defaultMoney, giftMoney, giftPoint, sortId, isEnable, description) VALUES (4, '冲1000送120', 1000, 120, 0, 1, true, '冲1000送120');
|
||||||
Reference in New Issue
Block a user