Browse Source

Merge branch 'feature-dgy-后台优化' into feature-dgy-机具回收

DuGuYang 3 years ago
parent
commit
d3926b6bcc

+ 33 - 2
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -170,7 +170,7 @@ namespace MySystem.Areas.Admin.Controllers
             string FailAmount = "0.00";//提现失败总金额
             string WaitTaxAmount = "0.00";//待处理总金额(税后)
             string SuccessTaxAmount = "0.00";//提现成功总金额(税后)
-            string FailTaxAmount= "0.00";//提现失败总金额(税后)
+            string FailTaxAmount = "0.00";//提现失败总金额(税后)
             DataTable dt = OtherMySqlConn.dtable("SELECT SUM(if(Status=0,TradeAmount,0)),SUM(if(Status=1,TradeAmount,0)),SUM(if(Status=2,TradeAmount,0)),SUM(if(Status=0,ActualTradeAmount,0)),SUM(if(Status=1,ActualTradeAmount,0)),SUM(if(Status=2,ActualTradeAmount,0)) FROM UserCashRecord where 1=1 " + condition);
             if (dt.Rows.Count > 0)
             {
@@ -1075,7 +1075,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (edit != null)
                 {
                     Users user = db.Users.FirstOrDefault(m => m.Id == edit.UserId) ?? new Users();
-                    if(!MakerCodeString.Contains("," + user.MakerCode + ","))
+                    if (!MakerCodeString.Contains("," + user.MakerCode + ","))
                     {
                         edit.QueryCount = 1;
                         edit.UpdateDate = DateTime.Now;
@@ -1245,5 +1245,36 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+
+        #region 退汇
+
+        /// <summary>
+        /// 退汇
+        /// </summary>
+        /// <returns></returns>
+        public string Refund(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "退汇", "Refund");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                var userCashRecord = db.UserCashRecord.FirstOrDefault(m => m.Id == id) ?? new UserCashRecord();
+                var userAccountRecord = db.UserAccountRecord.Where(m => m.Version == id).ToList();
+                foreach (var item in userAccountRecord)
+                {
+                    int recordId = item.Id;
+                    new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Delete("UserAccountRecord", recordId);
+                }
+                userCashRecord.Status = 0;
+                db.SaveChanges();
+            }
+
+            return "success";
+        }
+
+        #endregion
+
     }
 }

+ 3 - 0
Areas/Admin/Views/MainServer/UserCashRecord/Index.cshtml

@@ -156,6 +156,9 @@
                     {{# if(d.QueryCount == 1 && d.Status == 2) { }}
                     <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancel"><i class="layui-icon layui-icon-edit"></i>解除</a>
                     {{# } }}
+                    {{# if(d.QueryCount == 1 && d.Status == 1 && d.UpdateMan == '云汇算') { }}
+                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refund"><i class="layui-icon layui-icon-edit"></i>退汇</a>
+                    {{# } }}
                 </script>
             </div>
         </div>

BIN
wwwroot/.DS_Store


+ 18 - 0
wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

@@ -270,6 +270,24 @@ layui.config({
                     }
                 });
             });
+        } else if (obj.event === 'refund') {
+            var index = layer.confirm('确定要退汇吗?操作后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/UserCashRecord/Refund?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index);
+                        if (data == "success") {
+                            parent.layer.msg('已退汇');
+                            table.reload('LAY-list-manage'); //数据刷新
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
         } else if (obj.event === 'edit') {
             var tr = $(obj.tr);
             var perContent = layer.open({

+ 1 - 1
wwwroot/layuiadmin/modules_sp/BindRecord_Admin.js

@@ -107,7 +107,7 @@ layui.config({
             , { field: 'ProductType', width: 200, title: '产品类型', sort: true }
             , { field: 'MerNewSnNo', width: 200, title: '新终端机身号', sort: true }
             // , { field: 'UpdateTime', width: 200, title: '更新时间', sort: true }
-            , { field: 'ChannelSerial', width: 200, title: '渠道流水号', sort: true }
+            , { field: 'Field1', width: 200, title: '操作类型', sort: true }
 
             // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
             // , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }

+ 1 - 0
wwwroot/layuiadmin/modules_sp/UnBindRecord_Admin.js

@@ -102,6 +102,7 @@ layui.config({
             , { field: 'UnBindTime', width: 200, title: '解绑时间', sort: true }
             // , { field: 'ChannelSerial', width: 200, title: '渠道流水号', sort: true }
             , { field: 'AgentNo', width: 200, title: '机构号', sort: true }
+            , { field: 'Field1', width: 200, title: '操作类型', sort: true }
 
             // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
             // , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }