|
|
@@ -196,15 +196,20 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public string Edit(ToChargeBackRecord data)
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
-
|
|
|
- Fields.Add("UserId", data.UserId); //创客
|
|
|
+ var info = db.ToChargeBackRecord.FirstOrDefault(m => m.Id == data.Id) ?? new ToChargeBackRecord();
|
|
|
+ if (info.ChargeAmount != data.ChargeAmount)
|
|
|
+ {
|
|
|
+ var userAccount =db.UserAccount.FirstOrDefault(m => m.Id == info.UserId) ?? new UserAccount();
|
|
|
+ if (info.ChargeAmount > data.ChargeAmount)
|
|
|
+ {
|
|
|
+ userAccount.ToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
+ }
|
|
|
+ if (info.ChargeAmount < data.ChargeAmount)
|
|
|
+ {
|
|
|
+ userAccount.ToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
+ }
|
|
|
+ }
|
|
|
Fields.Add("ChargeAmount", data.ChargeAmount); //待扣金额
|
|
|
- Fields.Add("ChargeType", data.ChargeType); //待扣类型
|
|
|
- Fields.Add("Remark", data.Remark); //备注
|
|
|
- Fields.Add("Field1", data.Field1); //备用字段
|
|
|
-
|
|
|
- Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
- Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("ToChargeBackRecord", Fields, data.Id);
|
|
|
AddSysLog(data.Id.ToString(), "ToChargeBackRecord", "update");
|