DuGuYang 2 лет назад
Родитель
Сommit
ca8fb5f9da

+ 16 - 16
Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs

@@ -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";

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeBackRecord/Edit.cshtml

@@ -66,7 +66,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">待扣类别</label>
                                 <div class="layui-input-inline">
-                                    <select id="Kind" name="Kind" lay-search="" readonly>
+                                    <select id="Kind" name="Kind" disabled>
                                         <option value="0">创客预扣款</option>
                                         <option value="1">盟主预扣款</option>
                                         <option value="2">运营中心预扣款</option>

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeBackRecordSub/Edit.cshtml

@@ -55,7 +55,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">扣款开始时间</label>
                                 <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" id="StartDate" name="StartDate" readonly
+                                    <input class="layui-input" type="text" id="StartDate" name="StartDate" disabled
                                         value="@(editData.StartDate == null ? "" : editData.StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss"))"
                                         lay-verify="" autocomplete="off" placeholder="请输入扣款开始时间">
                                 </div>

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeByStage/Edit.cshtml

@@ -46,7 +46,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">待扣类别</label>
                                 <div class="layui-input-inline">
-                                    <select id="Kind" name="Kind" lay-search="" readonly>
+                                    <select id="Kind" name="Kind" disabled>
                                         <option value="0">创客预扣款</option>
                                         <option value="1">盟主预扣款</option>
                                         <option value="2">运营中心预扣款</option>