DuGuYang 3 년 전
부모
커밋
04bba6e9aa

+ 222 - 0
Areas/Admin/Controllers/MainServer/UserCashRecordForBusinessController.cs

@@ -0,0 +1,222 @@
+/*
+ * 直营团队提现记录
+ */
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Data;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using MySystem.Models;
+using Library;
+using LitJson;
+using MySystemLib;
+
+namespace MySystem.Areas.Admin.Controllers
+{
+    [Area("Admin")]
+    [Route("Admin/[controller]/[action]")]
+    public class UserCashRecordForBusinessController : BaseController
+    {
+        public UserCashRecordForBusinessController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        #region 提现记录列表
+
+        /// <summary>
+        /// 根据条件查询提现记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(UserCashRecordForBusiness data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            string Condition = "";
+            Condition += "CashOrderNo:\"" + data.CashOrderNo + "\",";
+            Condition += "TradeType:\"" + data.TradeType + "\",";
+
+            if (!string.IsNullOrEmpty(Condition))
+            {
+                Condition = Condition.TrimEnd(',');
+                Condition = ", where: {" + Condition + "}";
+            }
+            ViewBag.Condition = Condition;
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询提现记录列表
+
+        /// <summary>
+        /// 提现记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(UserCashRecordForBusiness data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("CashOrderNo", "1"); //提现单号
+            Fields.Add("TradeType", "0"); //交易类型
+
+            string condition = " and Status>-1 and TradeType<3";
+            //创客编号
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
+            }
+            //创客名称
+            if (!string.IsNullOrEmpty(RealName))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
+            }
+            //提现状态
+            if (!string.IsNullOrEmpty(StatusSelect))
+            {
+                condition += " and Status=" + StatusSelect;
+            }
+            if (!string.IsNullOrEmpty(data.CashOrderNo))
+            {
+                condition += " and CashOrderNo='" + data.CashOrderNo + "'";
+            }
+            if (data.TradeType > 0)
+            {
+                condition += " and TradeType=" + data.TradeType;
+            }
+            //提交到代付状态
+            if (!string.IsNullOrEmpty(QueryCountSelect))
+            {
+                if(QueryCountSelect == "0")
+                {
+                    condition += " and QueryCount=" + QueryCountSelect;
+                }
+                else
+                {
+                    condition += " and QueryCount>0";
+                }
+            }
+
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
+                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
+                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
+                var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
+                if (check)
+                {
+                    var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
+                    condition += "  and Id >=" + sId;
+                }
+                if (checks)
+                {
+                    var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
+                    condition += " and Id <=" + eId;
+                }
+            }
+            else
+            {
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
+                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
+                if (check)
+                {
+                    var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
+                    var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecordForBusiness.txt");
+                    if (string.IsNullOrEmpty(Info.ToString()))
+                    {
+                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
+                    else
+                    {
+                        condition += " and Id >=" + Convert.ToInt32(Info);
+                    }
+                }
+                else
+                {
+                    condition += " and Id =0";
+                }
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserCashRecordForBusiness", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                int UserId = int.Parse(dic["UserId"].ToString());
+                Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["MakerCode"] = user.MakerCode;
+                dic["RealName"] = user.RealName;
+                dic["TradeType"] = RelationClassForConst.GetTradeTypeInfo(int.Parse(dic["TradeType"].ToString()));
+                int Status = int.Parse(dic["Status"].ToString());
+                if (Status == 0) dic["StatusName"] = "处理中";
+                if (Status == 1) dic["StatusName"] = "成功";
+                if (Status == 2) dic["StatusName"] = "失败";
+
+                int QueryCount = int.Parse(dic["QueryCount"].ToString());
+                if (QueryCount == 0) dic["LockName"] = "待提交";
+                if (QueryCount > 0) dic["LockName"] = "已提交";
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+        #region 增加提现记录
+
+        /// <summary>
+        /// 增加或修改提现记录信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Add(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 增加提现记录
+
+        /// <summary>
+        /// 增加或修改提现记录信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Add(UserCashRecordForBusiness data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+            Fields.Add("Remark", data.Remark); //备注
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("UserCashRecordForBusiness", Fields, 0);
+            AddSysLog(data.Id.ToString(), "UserCashRecordForBusiness", "add");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+    }
+}

+ 209 - 0
Areas/Admin/Views/MainServer/UserCashRecordForBusiness/Add.cshtml

@@ -0,0 +1,209 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    
+}
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>直营团队提现记录(增加)</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <script src="/admin/js/LAreaData2.js"></script>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+<div class="layui-form-item layui-form-text">
+<label class="layui-form-label">备注</label>
+<div class="layui-input-block">
+<textarea class="layui-textarea" id="Remark" name="Remark" maxlength="128" lay-verify="" placeholder="请输入备注"></textarea>
+</div>
+</div>
+
+</div>
+
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        
+                    
+        //编辑器
+        KindEditor.ready(function (K) {
+            
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+        
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 100 - 0
Areas/Admin/Views/MainServer/UserCashRecordForBusiness/Index.cshtml

@@ -0,0 +1,100 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+
+}
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>直营团队提现记录</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline {
+            width: 175px !important;
+        }
+
+        .layui-form-label {
+            width: 85px !important;
+        }
+
+        .layui-inline {
+            margin-right: 0px !important;
+        }
+
+        .w100 {
+            width: 100px !important;
+        }
+
+        .ml50 {
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">提现单号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="CashOrderNo" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="MakerCode" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="RealName" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创建时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
+                                placeholder="创建时间" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
+                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
+                        </button>
+                        @if (RightInfo.Contains("," + right + "_export,"))
+                        {
+                            <button class="layui-btn" data-type="ExportExcel"><i
+                                class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+                        }
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/UserCashRecordForBusiness_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 4 - 0
Models/LeaderCompPrize.cs

@@ -17,6 +17,10 @@ namespace MySystem.Models
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public decimal CompPrize { get; set; }
+        public ulong IsComp { get; set; }
         public int SecDirectCount { get; set; }
         public int NotDirectCount { get; set; }
         public int DirectCount { get; set; }

+ 31 - 0
Models/LeaderCompTradeStat.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderCompTradeStat
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public decimal ResultTradeAmount { get; set; }
+        public decimal TradeAmount { get; set; }
+        public decimal CheckTradeAmount { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public int UserId { get; set; }
+        public string StatMonth { get; set; }
+        public decimal SelfResultTradeAmount { get; set; }
+        public decimal SelfTradeAmount { get; set; }
+        public decimal CheckSelfTradeAmount { get; set; }
+    }
+}

+ 42 - 0
Models/UserCashRecordForBusiness.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class UserCashRecordForBusiness
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Remark { get; set; }
+        public string MediaSource { get; set; }
+        public string Ip { get; set; }
+        public DateTime? PaymentDate { get; set; }
+        public string ReturnMsg { get; set; }
+        public string ReturnCode { get; set; }
+        public string ResData { get; set; }
+        public string ReqData { get; set; }
+        public decimal ManageFee { get; set; }
+        public decimal TradeFee { get; set; }
+        public decimal ActualTradeAmount { get; set; }
+        public decimal TradeAmount { get; set; }
+        public string ChanelName { get; set; }
+        public string ChannelCode { get; set; }
+        public string PayTradeNo { get; set; }
+        public int TradeType { get; set; }
+        public string SettleBankName { get; set; }
+        public string SettleBankCardNo { get; set; }
+        public string IdCardNo { get; set; }
+        public int UserId { get; set; }
+        public string CashOrderNo { get; set; }
+    }
+}

+ 255 - 1
Models/WebCMSEntities.cs

@@ -71,6 +71,7 @@ namespace MySystem.Models
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
         public virtual DbSet<LeaderCompPrize> LeaderCompPrize { get; set; }
+        public virtual DbSet<LeaderCompTradeStat> LeaderCompTradeStat { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
@@ -235,6 +236,7 @@ namespace MySystem.Models
         public virtual DbSet<UserCardForWeChat> UserCardForWeChat { get; set; }
         public virtual DbSet<UserCardRecord> UserCardRecord { get; set; }
         public virtual DbSet<UserCashRecord> UserCashRecord { get; set; }
+        public virtual DbSet<UserCashRecordForBusiness> UserCashRecordForBusiness { get; set; }
         public virtual DbSet<UserCenterIconList> UserCenterIconList { get; set; }
         public virtual DbSet<UserCollection> UserCollection { get; set; }
         public virtual DbSet<UserData> UserData { get; set; }
@@ -4193,6 +4195,10 @@ namespace MySystem.Models
 
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
+                entity.Property(e => e.CompPrize)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("达标奖励");
+
                 entity.Property(e => e.CreateDate)
                     .HasColumnType("datetime")
                     .HasComment("创建时间");
@@ -4207,9 +4213,24 @@ namespace MySystem.Models
                     .HasColumnType("int(11)")
                     .HasComment("直推达标人数");
 
+                entity.Property(e => e.IsComp)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'")
+                    .HasComment("是否达标");
+
                 entity.Property(e => e.NotDirectCount)
                     .HasColumnType("int(11)")
-                    .HasComment("简推达标人数");
+                    .HasComment("间推达标人数");
+
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("varchar(1000)")
+                    .HasComment("上级创客集合")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("上级创客");
 
                 entity.Property(e => e.QueryCount)
                     .HasColumnType("int(11)")
@@ -4267,6 +4288,108 @@ namespace MySystem.Models
                     .HasComment("版本号");
             });
 
+            modelBuilder.Entity<LeaderCompTradeStat>(entity =>
+            {
+                entity.HasComment("领导人达标奖交易额统计");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CheckSelfTradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("个人环比月交易额");
+
+                entity.Property(e => e.CheckTradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("环比月交易额");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("varchar(1000)")
+                    .HasComment("上级创客集合")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("上级创客");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.ResultTradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("增量交易");
+
+                entity.Property(e => e.SelfResultTradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("个人增量交易");
+
+                entity.Property(e => e.SelfTradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("个人当月交易额");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.StatMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasComment("统计月份")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.TradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("当月交易额");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<LeaderReserveRecord>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -16326,6 +16449,137 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserCashRecordForBusiness>(entity =>
+            {
+                entity.HasComment("直营团队提现记录");
+
+                entity.HasIndex(e => new { e.UserId, e.TradeType, e.CashOrderNo })
+                    .HasName("UserCashRecordIndex");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActualTradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CashOrderNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ChanelName)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ChannelCode)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IdCardNo)
+                    .HasColumnType("varchar(18)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Ip)
+                    .HasColumnType("varchar(15)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ManageFee).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.MediaSource)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PayTradeNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PaymentDate).HasColumnType("datetime");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(128)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReqData)
+                    .HasColumnType("varchar(2048)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ResData)
+                    .HasColumnType("varchar(2048)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReturnCode)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReturnMsg)
+                    .HasColumnType("varchar(128)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SettleBankCardNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SettleBankName)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeFee).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeType).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<UserCenterIconList>(entity =>
             {
                 entity.HasComment("个人中心常用工具");

+ 297 - 0
wwwroot/layuiadmin/modules_main/UserCashRecordForBusiness_Admin copy.js

@@ -0,0 +1,297 @@
+var ExcelData;
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$,
+        form = layui.form,
+        table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+
+
+    //excel导入
+    excel = layui.excel;
+    $('#ExcelFile').change(function (e) {
+        var files = e.target.files;
+        excel.importExcel(files, {}, function (data) {
+            ExcelData = data[0].sheet1;
+        });
+    });
+
+    //监听单元格编辑
+    table.on('edit(LAY-list-manage)', function (obj) {
+        var value = obj.value //得到修改后的值
+            ,
+            data = obj.data //得到所在行所有键值
+            ,
+            field = obj.field; //得到字段
+        if (field == "Sort") {
+            $.ajax({
+                type: "POST",
+                url: "/Admin/UserCashRecord/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) { }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage',
+        url: '/Admin/UserCashRecord/IndexData' //模拟接口
+        ,
+        cols: [
+            [{
+                type: 'checkbox',
+                fixed: 'left'
+            }, {
+                field: 'CashOrderNo',
+                width: 200,
+                title: '提现单号',
+                sort: true
+            }, {
+                field: 'MakerCode',
+                width: 200,
+                title: '创客编码',
+                sort: true
+            }, {
+                field: 'RealName',
+                width: 200,
+                title: '创客名称',
+                sort: true
+            }, {
+                field: 'IdCardNo',
+                width: 200,
+                title: '身份证号',
+                sort: true
+            }, {
+                field: 'SettleBankCardNo',
+                width: 200,
+                title: '提现卡号',
+                sort: true
+            }, {
+                field: 'SettleBankName',
+                width: 200,
+                title: '银行名称',
+                sort: true
+            }, {
+                field: 'TradeType',
+                width: 200,
+                title: '交易类型',
+                sort: true
+            }, {
+                field: 'TradeAmount',
+                width: 200,
+                title: '提现金额(元)',
+                sort: true
+            }, {
+                field: 'ActualTradeAmount',
+                width: 200,
+                title: '发佣金额(元)',
+                sort: true
+            }, {
+                field: 'ManageFee',
+                width: 200,
+                title: '交易扣税(元)',
+                sort: true
+            }, {
+                field: 'TradeFee',
+                width: 200,
+                title: '交易手续费(元)',
+                sort: true
+            }, {
+                field: 'StatusName',
+                width: 200,
+                title: '订单状态',
+                templet: '#StatusTpl',
+                sort: true
+            }, {
+                field: 'LockName',
+                width: 200,
+                title: '提现标记',
+                sort: true
+            }, {
+                field: 'ReturnCode',
+                width: 200,
+                title: '提现服务返回编码',
+                sort: true
+            }, {
+                field: 'ReturnMsg',
+                width: 200,
+                title: '提现服务返回信息',
+                sort: true
+            }, {
+                field: 'SeoKeyword',
+                width: 200,
+                title: '备注',
+                sort: true
+            }, {
+                field: 'Remark',
+                width: 200,
+                title: '代付返回信息',
+                sort: true
+            }, {
+                field: 'CreateDate',
+                width: 200,
+                title: '创建时间',
+                sort: true
+            }, { title: '操作', align: 'center', width: 300, fixed: 'right', toolbar: '#table-list-tools' }
+
+            ]
+        ],
+        where: {
+
+        },
+        page: true,
+        limit: 30,
+        height: 'full-' + String($('.layui-card-header').height() + 130),
+        text: '对不起,加载出现异常!',
+        done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        add: function () {
+            var perContent = layer.open({
+                type: 2,
+                title: '直营团队提现记录-添加',
+                content: 'Add',
+                maxmin: true,
+                area: ['500px', '450px'],
+                btn: ['确定', '取消'],
+                yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index],
+                        submitID = 'LAY-list-front-submit',
+                        submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        var index = layer.confirm('确定要进行提现吗?', function (index) {
+                            $.ajax({
+                                type: "POST",
+                                url: "/Admin/UserCashRecord/Add?r=" + Math.random(1),
+                                data: userdata,
+                                dataType: "text",
+                                success: function (data) {
+                                    layer.close(index); //关闭弹层
+                                    if (data == "success") {
+                                        table.reload('LAY-list-manage'); //数据刷新
+                                    } else {
+                                        layer.msg(data);
+                                    }
+                                }
+                            });
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+            layer.full(perContent);
+        },
+        ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/UserCashRecord/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
+            });
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});