修改订单价格

This commit is contained in:
zpc 2024-08-26 11:33:41 +08:00
parent fa81bfd853
commit 9140db4e33
3 changed files with 13 additions and 1 deletions

View File

@ -48,8 +48,14 @@ namespace HuanMeng.MiaoYu.Code.Order
try
{
var ip = HttpContextAccessor.HttpContext.GetClientIpAddress();
var price = product.Price;
var payment = PaymentExtend.GetPayment(paymentMethod);
(var orderId, var order) = await payment.CreateOrder(product.ProductName, product.Price, product, ip);
UserInfoBLL userInfo = new UserInfoBLL(Dao, _UserId);
if (userInfo.User.IsTest ?? false)
{
price = (decimal)0.01;
}
(var orderId, var order) = await payment.CreateOrder(product.ProductName, price, product, ip);
var t = product.ToIntentOrder(paymentMethod, orderId);
t.UserId = _UserId;
Dao.daoDbMiaoYu.context.Add(t);

View File

@ -942,6 +942,7 @@ public partial class MiaoYuContext : MultiTenantDbContext//DbContext
.HasMaxLength(100)
.HasComment("Ip地址");
entity.Property(e => e.IsActive).HasComment("是否活跃");
entity.Property(e => e.IsTest).HasComment("是否是测试账号");
entity.Property(e => e.LastLoginAt)
.HasComment("最后一次登录时间")
.HasColumnType("datetime");

View File

@ -73,4 +73,9 @@ public partial class T_User: MultiTenantEntity
/// 0正常1注销
/// </summary>
public virtual int State { get; set; }
/// <summary>
/// 是否是测试账号
/// </summary>
public virtual bool? IsTest { get; set; }
}