|
|
@@ -256,28 +256,28 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public string Edit(ToChargeBackRecord data)
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ var editInfo = "";
|
|
|
var info = db.ToChargeBackRecord.FirstOrDefault(m => m.Id == data.Id) ?? new ToChargeBackRecord();
|
|
|
if (info.ChargeAmount != data.ChargeAmount)
|
|
|
{
|
|
|
- if (info.Kind != data.Kind)
|
|
|
+ var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == info.UserId) ?? new UserAccount();
|
|
|
+ editInfo = "变更前:" + "\n" + "创客预扣款:" + userAccount.ToChargeAmount + " " + "盟主预扣款:" + userAccount.LeaderToChargeAmount + " " + "合伙人预扣款:" + userAccount.OperateToChargeAmount + "\n";
|
|
|
+ if (info.ChargeAmount > data.ChargeAmount)
|
|
|
{
|
|
|
- var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == info.UserId) ?? new UserAccount();
|
|
|
- if (info.ChargeAmount > data.ChargeAmount)
|
|
|
- {
|
|
|
- if (data.Kind == 0) userAccount.ToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
- if (data.Kind == 1) userAccount.LeaderToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
- if (data.Kind == 2) userAccount.OperateToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
- }
|
|
|
- if (info.ChargeAmount < data.ChargeAmount)
|
|
|
- {
|
|
|
- if (data.Kind == 0) userAccount.ToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
- if (data.Kind == 1) userAccount.LeaderToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
- if (data.Kind == 2) userAccount.OperateToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
- }
|
|
|
+ if (info.Kind == 0) userAccount.ToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
+ if (info.Kind == 1) userAccount.LeaderToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
+ if (info.Kind == 2) userAccount.OperateToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
|
|
|
+ }
|
|
|
+ if (info.ChargeAmount < data.ChargeAmount)
|
|
|
+ {
|
|
|
+ if (info.Kind == 0) userAccount.ToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
+ if (info.Kind == 1) userAccount.LeaderToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
+ if (info.Kind == 2) userAccount.OperateToChargeAmount += data.ChargeAmount - info.ChargeAmount;
|
|
|
}
|
|
|
+ editInfo = "变更后:" + "\n" + "创客预扣款:" + userAccount.ToChargeAmount + " " + "盟主预扣款:" + userAccount.LeaderToChargeAmount + " " + "合伙人预扣款:" + userAccount.OperateToChargeAmount + "\n";
|
|
|
}
|
|
|
Fields.Add("ChargeAmount", data.ChargeAmount); //待扣金额
|
|
|
- Fields.Add("Kind", data.Kind); //待扣金额
|
|
|
+ // Fields.Add("Kind", data.Kind); //待扣金额
|
|
|
Fields.Add("SeoTitle", SysUserName + "_" + SysRealName);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
if (info.ChargeType != 124)
|
|
|
@@ -285,7 +285,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("Remark", data.SeoDescription);
|
|
|
}
|
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("ToChargeBackRecord", Fields, data.Id);
|
|
|
- AddSysLog(data.Id.ToString(), "ToChargeBackRecord", "update");
|
|
|
+ AddSysLog(data.Id.ToString() + "\n" + editInfo, "ToChargeBackRecord", "update");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
return "success";
|