Просмотр исходного кода

Merge branch 'DuGuYang' into develop

lcl 3 лет назад
Родитель
Сommit
9af5aef827

+ 42 - 2
Areas/Admin/Controllers/MainServer/MsgAlertController.cs

@@ -95,7 +95,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (MsgType == 2) dic["MsgType"] = "图片";
                 if (MsgType == 3) dic["MsgType"] = "动图";
                 if (MsgType == 0) dic["MsgType"] = "";
-                dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
+                dic["StatusName"] = dic["Status"].ToString() == "1" ? "使用中" : "已关闭";
                 //推送类型
                 int PushType = int.Parse(dic["PushType"].ToString());
                 if (PushType == 0) dic["PushType"] = "不推送";
@@ -186,6 +186,7 @@ namespace MySystem.Areas.Admin.Controllers
                     }
                     else
                     {
+                        new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Delete("MsgAlert", Id);
                         return "创客" + item + "不存在或者已经添加了相关信息";
                     }
                 }
@@ -212,6 +213,17 @@ namespace MySystem.Areas.Admin.Controllers
 
             MsgAlert editData = db.MsgAlert.FirstOrDefault(m => m.Id == Id) ?? new MsgAlert();
             ViewBag.data = editData;
+            var userSwapWhite = db.UserSwapWhite.Where(m => m.QueryCount == Id).ToList();
+            var makerInfo = "";
+            foreach (var item in userSwapWhite)
+            {
+                var user = db.Users.FirstOrDefault(m => m.Id == item.UserId) ?? new Users();
+                if (user.Id > 0)
+                {
+                    makerInfo += user.MakerCode + ",";
+                }
+            }
+            ViewBag.makerInfo = makerInfo.TrimEnd(',');
             return View();
         }
 
@@ -224,7 +236,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// </summary>
         /// <returns></returns>
         [HttpPost]
-        public string Edit(MsgAlert data)
+        public string Edit(MsgAlert data, string MakerCodes)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
 
@@ -250,6 +262,34 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoDescription", data.SeoDescription);
             new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgAlert", Fields, data.Id);
+            var duserSwapWhite = db.UserSwapWhite.Where(m => m.QueryCount == data.Id).ToList();
+            foreach (var item in duserSwapWhite)
+            {
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Delete("UserSwapWhite", item.Id);
+            }
+            if (!string.IsNullOrEmpty(MakerCodes))
+            {
+                string[] MakerCodeList = MakerCodes.Replace("\r", "").Replace("\n", ",").Split(',');
+                foreach (var item in MakerCodeList)
+                {
+                    var userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == item) ?? new UserForMakerCode();
+                    var userSwapWhite = db.UserSwapWhite.FirstOrDefault(m => m.QueryCount == data.Id && m.UserId == userForMakerCode.UserId) ?? new UserSwapWhite();
+                    if (userForMakerCode.UserId > 0 && userSwapWhite.Id == 0)
+                    {
+                        var userSwapWhiteAdd = db.UserSwapWhite.Add(new UserSwapWhite()
+                        {
+                            QueryCount = data.Id,//弹窗Id
+                            CreateDate = DateTime.Now,
+                            CreateMan = SysUserName + "_" + SysRealName,
+                            UserId = userForMakerCode.UserId,
+                        }).Entity;
+                    }
+                    else
+                    {
+                        return "创客" + item + "不存在或者已经添加了相关信息";
+                    }
+                }
+            }
             AddSysLog(data.Id.ToString(), "MsgAlert", "update");
             db.SaveChanges();
 

+ 115 - 0
Areas/Admin/Controllers/MainServer/SetMerchantTypeRecordController.cs

@@ -0,0 +1,115 @@
+/*
+ * 设置商户型创客记录
+ */
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+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 SetMerchantTypeRecordController : BaseController
+    {
+        public SetMerchantTypeRecordController(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(StoreSwapSn data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询设置商户型创客记录
+
+        /// <summary>
+        /// 设置商户型创客记录
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(SetMerchantTypeRecord data, string PosSn, string MerUserTypeMakerCode, string PosFromMakerCode, string OperateTypeSelect, string CreateDateData, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("PosSn", "1"); //SN号
+
+            string condition = " and Status>-1";
+            //商户型创客编号
+            if (!string.IsNullOrEmpty(MerUserTypeMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MerUserTypeMakerCode + "')";
+            }
+            //机具所属创客编号
+            if (!string.IsNullOrEmpty(PosFromMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + PosFromMakerCode + "')";
+            }
+            //操作类型
+            if(!string.IsNullOrEmpty(OperateTypeSelect))
+            {
+                condition += " and OperateType=" + OperateTypeSelect;
+            }
+            //操作时间
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SetMerchantTypeRecord", 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)
+            {
+                // dic["BrandName"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+
+                //商户型创客信息
+                int ToUserId = int.Parse(dic["ToUserId"].ToString());
+                Users tuser = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["MerUserTypeMakerCode"] = tuser.MakerCode;
+                dic["MerUserTypeName"] = tuser.RealName;
+
+                //机具所属创客信息
+                int FromUserId = int.Parse(dic["FromUserId"].ToString());
+                Users fuser = db.Users.FirstOrDefault(m => m.Id == FromUserId) ?? new Users();
+                dic["PosFromMakerCode"] = fuser.MakerCode;
+                dic["PosFromName"] = fuser.RealName;
+                
+                //业务状态
+                int OperateType = int.Parse(dic["OperateType"].ToString());
+                if(OperateType == 1) dic["OperateTypeName"] = "设置";
+                if(OperateType == 2) dic["OperateTypeName"] = "取消";
+
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+    }
+}

+ 119 - 152
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -896,30 +896,59 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "创客编号不存在";
             }
-            PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == PosSn);
-            pos.UserId = pos.BuyUserId;
-            merchant.UserId = pos.BuyUserId;
-            merchant.MerUserType = 0;
-            user.MerchantType = 0;
-            db.SaveChanges();
-            if (pos.BindMerchantId == 0)
+            PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.KqSnNo == PosSn) ?? new PosMerchantInfo();
+            if (merchant.Id == 0)
             {
-                pos.BindMerchantId = merchant.Id;
-                if (IsSend == 1)
+                return "机具" + PosSn + "对应的商户不存在";
+            }
+            else if (merchant.MerUserType == 1 && merchant.UserId == user.Id)
+            {
+                pos.UserId = pos.BuyUserId;
+                merchant.UserId = pos.BuyUserId;
+                merchant.MerUserType = 0;
+                user.MerchantType = 0;
+                db.SetMerchantTypeRecord.Add(new SetMerchantTypeRecord()
                 {
-                    RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                    CreateDate = DateTime.Now,
+                    SeoTitle = SysUserName + "_" + SysRealName,
+                    IsRecyc = (ulong)pos.IsPurchase,
+                    CreditAmount = pos.CreditTrade,
+                    PosSnType = pos.PosSnType,
+                    ActDate = pos.ActivationTime,
+                    BindDate = pos.BindingTime,
+                    ActStatus = (ulong)pos.ActivationState,
+                    BindStatus = (ulong)pos.BindingState,
+                    MerNo = merchant.KqMerNo,
+                    PosSn = pos.PosSn,
+                    Note = "后台取消商户型创客",
+                    ToUserId = user.Id,
+                    FromUserId = pos.BuyUserId,
+                    OperateType = 2,
+                    BuyUserId = pos.BuyUserId,
+                });
+                db.SaveChanges();
+                if (pos.BindMerchantId == 0)
+                {
+                    pos.BindMerchantId = merchant.Id;
+                    if (IsSend == 1)
                     {
-                        UserId = pos.BuyUserId, //接收创客
-                        MsgType = 2,
-                        Title = "商户型代理取消成功", //标题
-                        Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已给下级代理" + user.RealName + "" + MakerCode + "取消成功",
-                        CreateDate = DateTime.Now,
-                    }));
+                        RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                        {
+                            UserId = pos.BuyUserId, //接收创客
+                            MsgType = 2,
+                            Title = "商户型代理取消成功", //标题
+                            Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已给下级代理" + user.RealName + "" + MakerCode + "取消成功",
+                            CreateDate = DateTime.Now,
+                        }));
+                    }
                 }
+                string text = string.Format("取消商户代理,创客编号: " + user.MakerCode + ",机具SN:" + pos.PosSn + ",操作人:" + SysRealName + ",Time:" + DateTime.Now + "");
+                function.WriteLog(text, "CancelMerAgent");//取消商户型代理日志
+            }
+            else
+            {
+                return "未找到相关信息";
             }
-            string text = string.Format("取消商户代理,创客编号: " + user.MakerCode + ",机具SN:" + pos.PosSn + ",操作人:" + SysRealName + ",Time:" + DateTime.Now + "");
-            function.WriteLog(text, "CancelMerAgent");//取消商户型代理日志
-
             return "success";
         }
 
@@ -3973,29 +4002,29 @@ namespace MySystem.Areas.Admin.Controllers
                         SourceStoreId = posInfo.SourceStoreId, //源仓库
                         ToUserId = tUserId.Id,//收货创客
                     });
-                    // UserStoreChange userstore = db.UserStoreChange.Add(new UserStoreChange()
-                    // {
-                    //     CreateDate = DateTime.Now,
-                    //     UserId = fUserId.Id, //创客
-                    //     BrandId = posInfo.BrandId, //产品类型
-                    //     ChangeRecordNo = ChangeRecordNo, //变更记录单号
-                    //     TransType = 0, //交易类型
-                    //     SnNo = posInfo.PosSn, //SN编号
-                    //     SnType = posInfo.PosSnType, //SN机具类型
-                    //     StockOpDirect = 0, //库存操作方向
-                    //     DeviceVendor = posInfo.DeviceName, //设备厂商
-                    //     DeviceType = posInfo.DeviceKind, //设备类型
-                    //     DeviceModel = posInfo.DeviceType, //设备型号
-                    //     ToUserId = tUserId.Id, //收货创客
-                    //     ToDate = DateTime.Now, //入库时间
-                    //     SourceStoreId = posInfo.SourceStoreId, //源仓库
-                    //     SnStatus = 1, //SN状态
-                    //     BindStatus = (int)posInfo.BindingState, //绑定状态
-                    //     BindMerchantId = posInfo.BindMerchantId, //绑定商户
-                    //     ActiveStatus = (int)posInfo.ActivationState, //激活状态
-                    //     ActRewardUserId = posInfo.BuyUserId, //激活奖励创客
-                    //     BrandType = posInfo.DeviceType, //品牌类型
-                    // }).Entity;
+                    UserStoreChange userstore = db.UserStoreChange.Add(new UserStoreChange()
+                    {
+                        CreateDate = DateTime.Now,
+                        UserId = fUserId.Id, //创客
+                        BrandId = posInfo.BrandId, //产品类型
+                        ChangeRecordNo = ChangeRecordNo, //变更记录单号
+                        TransType = 0, //交易类型
+                        SnNo = posInfo.PosSn, //SN编号
+                        SnType = posInfo.PosSnType, //SN机具类型
+                        StockOpDirect = 0, //库存操作方向
+                        DeviceVendor = posInfo.DeviceName, //设备厂商
+                        DeviceType = posInfo.DeviceKind, //设备类型
+                        DeviceModel = posInfo.DeviceType, //设备型号
+                        ToUserId = tUserId.Id, //收货创客
+                        ToDate = DateTime.Now, //入库时间
+                        SourceStoreId = posInfo.SourceStoreId, //源仓库
+                        SnStatus = 1, //SN状态
+                        BindStatus = (int)posInfo.BindingState, //绑定状态
+                        BindMerchantId = posInfo.BindMerchantId, //绑定商户
+                        ActiveStatus = (int)posInfo.ActivationState, //激活状态
+                        ActRewardUserId = posInfo.BuyUserId, //激活奖励创客
+                        BrandType = posInfo.DeviceType, //品牌类型
+                    }).Entity;
                 }
                 var query = SnIds + ";" + FromMakerCode + ";" + ToMakerCode;
                 function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
@@ -4128,88 +4157,6 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
-        public string BadPosToStoreDo(string OldSn)
-        {
-            string[] OldSnList;
-            OldSnList = OldSn.Replace("\r", "").Split('\n');
-            string error = "";
-            List<string> opData = new List<string>();
-            for (int i = 0; i < OldSnList.Length; i++)
-            {
-                string OldSnNum = OldSnList[i];
-                MachineForSnNo oldForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == OldSnNum) ?? new MachineForSnNo();
-                PosMachinesTwo oldpos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == oldForSnNo.SnId) ?? new PosMachinesTwo();
-                if (!opData.Contains(oldpos.BuyUserId + ":" + oldpos.BrandId))
-                {
-                    opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
-                }
-                oldpos.Status = 1;
-                oldpos.PosSnType = 0;
-                oldpos.QueryCount = 0;
-                oldpos.UpdateDate = null;
-                oldpos.ActivityList = null;
-                oldpos.SeoKeyword = null;
-                oldpos.SeoDescription = null;
-                oldpos.OrderId = 0;
-                oldpos.RecycEndDate = null;
-                oldpos.RecycBackCount = 0;
-                oldpos.PrizeParams = null;
-                oldpos.ScanQrTrade = 0;
-                oldpos.BindMerchantId = 0;
-                oldpos.CreditTrade = 0;
-                oldpos.DebitCardTrade = 0;
-                oldpos.IsVip = 0;
-                oldpos.UserNav = null;
-                oldpos.TransferTime = null;
-                oldpos.IsPurchase = 0;
-                oldpos.Detail = null;
-                oldpos.BindingTime = null;
-                oldpos.BindingState = 0;
-                oldpos.ActivationTime = null;
-                oldpos.ActivationState = 0;
-                oldpos.LeaderUserId = 0;
-                oldpos.PreUserId = 0;
-                oldpos.IsFirst = 0;
-                oldpos.DownFeeMan = null;
-                oldpos.DownFeeFlag = 0;
-                oldpos.DownFeeDate = null;
-                oldpos.UpFeeMan = null;
-                oldpos.UpFeeFlag = 0;
-                oldpos.UpFeeDate = null;
-                oldpos.OpReserve1 = 0;
-                oldpos.OpReserve2 = 0;
-                oldpos.OpReserve3 = 0;
-                oldpos.OpId = 0;
-                oldpos.RecycStartDate = null;
-                oldpos.SourcePosSn = null;
-                oldpos.BuyUserId = 0;
-                oldpos.UserId = 0;
-                PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
-            }
-            if (!string.IsNullOrEmpty(error))
-            {
-                return "Warning|" + error;
-            }
-            db.SaveChanges();
-            foreach (string sub in opData)
-            {
-                string[] datalist = sub.Split(":");
-                PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
-            }
-            return "success";
-        }
-        #endregion
-
-        #region 划拨创客机具券
-
-        public IActionResult TransferPosCoupon(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
         public string TransferPosCouponDo(string Kind, string PosCouponCodes, string FromMakerCode, string ToMakerCode, string LeaderMakerCode = "")
         {
             if (string.IsNullOrEmpty(Kind))
@@ -4270,39 +4217,59 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     return "机具券" + PosCouponCode + "已使用";
                 }
+                if (item.QueryCount != int.Parse(Kind))
+                {
+                    return "机具券" + PosCouponCode + "类型和您选择的类型不同";
+                }
                 item.UserId = tUserId.Id;
                 if (LeaderUserId > 0 && item.LeaderUserId == 0)
                 {
                     item.LeaderUserId = LeaderUserId;
                 }
-                // PosCouponRecord posCouponRecord = db.PosCouponRecord.Add(new PosCouponRecord()
-                // {
-                //     QueryCount = item.QueryCount,//券类型(1 电签 2 大POS)
-                //     CreateDate = DateTime.Now,
-                //     ChangeKind = 1,//类型(0购买,1划拨,2使⽤,3申请机具循环驳回)
-                //     OrderNo = ChangeRecordNo,
-                //     ToUserId = tUserId.Id,
-                //     FromUserId = fUserId.Id,
-                //     PosCouponId = item.Id,
-                // }).Entity;
-            }
-            // int CouponCount = PosCouponList.Length;
-            // PosCouponOrders stat = db.PosCouponOrders.Add(new PosCouponOrders()
-            // {
-            //     QueryCount = 2,
-            //     CreateDate = DateTime.Now,
-            //     ChangeKind = 2,
-            //     ChangeCount = CouponCount,
-            //     // AfterOut = AfterOut,
-            //     // AfterTotal = AfterTotal,
-            //     // AfterStock = AfterStock,
-            //     // BeforeOut = BeforeOut,
-            //     // BeforeTotal = BeforeTotal,
-            //     // BeforeStock = BeforeStock,
-            //     OrderNo = ChangeRecordNo,
-            //     ToUserId = tUserId.Id,
-            //     FromUserId = fUserId.Id,
-            // }).Entity;
+                PosCouponRecord posCouponRecord = db.PosCouponRecord.Add(new PosCouponRecord()
+                {
+                    QueryCount = item.QueryCount,//券类型(1 电签 2 大POS)
+                    CreateDate = DateTime.Now,
+                    ChangeKind = 1,//类型(0购买,1划拨,2使⽤,3申请机具循环驳回)
+                    OrderNo = ChangeRecordNo,
+                    ToUserId = tUserId.Id,
+                    FromUserId = fUserId.Id,
+                    PosCouponId = item.Id,
+                }).Entity;
+            }
+            int CouponCount = PosCouponList.Length;
+            PosCouponOrders stat = db.PosCouponOrders.Add(new PosCouponOrders()
+            {
+                QueryCount = int.Parse(Kind),
+                CreateDate = DateTime.Now,
+                ChangeKind = 2,
+                ChangeCount = CouponCount,
+                // AfterOut = AfterOut,
+                // AfterTotal = AfterTotal,
+                // AfterStock = AfterStock,
+                // BeforeOut = BeforeOut,
+                // BeforeTotal = BeforeTotal,
+                // BeforeStock = BeforeStock,
+                OrderNo = ChangeRecordNo,
+                ToUserId = tUserId.Id,
+                FromUserId = fUserId.Id,
+            }).Entity;
+            PosCouponOrders tostat = db.PosCouponOrders.Add(new PosCouponOrders()
+            {
+                QueryCount = int.Parse(Kind),
+                CreateDate = DateTime.Now,
+                ChangeKind = 1,
+                ChangeCount = CouponCount,
+                // AfterOut = AfterOut,
+                // AfterTotal = AfterTotal,
+                // AfterStock = AfterStock,
+                // BeforeOut = BeforeOut,
+                // BeforeTotal = BeforeTotal,
+                // BeforeStock = BeforeStock,
+                OrderNo = ChangeRecordNo,
+                ToUserId = fUserId.Id,
+                FromUserId = tUserId.Id,
+            }).Entity;
             db.SaveChanges();
             db.Dispose();
 

+ 102 - 58
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -674,7 +674,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 盟主提现记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -704,57 +704,59 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and TradeType=" + data.TradeType;
             }
-            //提交到代付状态
-            if (!string.IsNullOrEmpty(QueryCountSelect))
-            {
-                condition += " and QueryCount=" + QueryCountSelect;
-            }
             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/LeaderUserCashRecord.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and Id =0";
-                }
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            // 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/LeaderUserCashRecord.txt");
+            //         if (string.IsNullOrEmpty(Info.ToString()))
+            //         {
+            //             function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
+            //             condition += " and Id >=" + minId;
+            //         }
+            //         else if (minId != int.Parse(Info))
+            //         {
+            //             function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.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("UserCashRecord", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -801,11 +803,10 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus)
+        public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string CreateDateData)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("CashOrderNo", "1"); //提现单号
-            Fields.Add("CreateDate", "3"); //创建时间
 
             string condition = " and Status>-1 and TradeType=3";
             //创客编号
@@ -823,16 +824,59 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and Status=" + StatusSelect;
             }
-            //提交到代付状态
-            if (!string.IsNullOrEmpty(PayStatus))
+            if (!string.IsNullOrEmpty(CreateDateData))
             {
-                int QueryCount = int.Parse(function.CheckInt(PayStatus));
-                if (QueryCount == 2)
-                {
-                    QueryCount = 0;
-                }
-                condition += " and QueryCount=" + QueryCount;
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            // 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/LeaderUserCashRecord.txt");
+            //         if (string.IsNullOrEmpty(Info.ToString()))
+            //         {
+            //             function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
+            //             condition += " and Id >=" + minId;
+            //         }
+            //         else if (minId != int.Parse(Info))
+            //         {
+            //             function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.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("UserCashRecord", Fields, "Id desc", "0", 1, 20000, condition, "CashOrderNo,UserId,IdCardNo,ActualTradeAmount,Remark,Status,QueryCount,CreateDate", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;

+ 6 - 84
Areas/Admin/Controllers/MainServer/UserCashRecordForBusinessController.cs

@@ -86,48 +86,9 @@ namespace MySystem.Areas.Admin.Controllers
             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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                var checks = db.UserCashRecordForBusiness.Any(m => m.CreateDate <= end);
-                if (check)
-                {
-                    var sId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    condition += "  and Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecordForBusiness.Where(m => m.CreateDate <= end).Max(m => m.Id);
-                    condition += " and Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                if (check)
-                {
-                    var minId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).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";
-                }
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserCashRecordForBusiness", Fields, "Id desc", "0", page, limit, condition);
@@ -268,48 +229,9 @@ namespace MySystem.Areas.Admin.Controllers
             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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                var checks = db.UserCashRecordForBusiness.Any(m => m.CreateDate <= end);
-                if (check)
-                {
-                    var sId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    condition += "  and a.Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecordForBusiness.Where(m => m.CreateDate <= end).Max(m => m.Id);
-                    condition += " and a.Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                if (check)
-                {
-                    var minId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).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 a.Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
-                        condition += " and a.Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and a.Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and a.Id =0";
-                }
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
             }
             var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客姓名',a.CashOrderNo '提现单号',a.TradeAmount '提现金额',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '提现时间',a.SeoKeyword '备注',a.CreateMan '操作人' FROM UserCashRecordForBusiness a LEFT JOIN Users b ON a.UserId=b.Id" + condition;
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);

+ 3 - 3
Areas/Admin/Views/MainServer/MsgAlert/Add.cshtml

@@ -174,7 +174,7 @@
                                 </div>
                             </div>
                             <div class="layui-form-item" id="MakerCode" style="display: none;">
-                                <label class="layui-form-label">创客编号</label>
+                                <label class="layui-form-label">指定推送创客编号</label>
                                 <div class="layui-input-block">
                                     <textarea class="layui-textarea" lay-verify="" name="MakerCodes" id="MakerCodes" placeholder="请输入创客编号,多个创客编号用回车隔开"></textarea>
                                 </div>
@@ -345,12 +345,12 @@
                     $('#BgPics').hide();
                     $('#Button').show();
                 } else if (data.value == '2') {
-                    $('#Titles').hide();
+                    $('#Titles').show();
                     $('#BgPics').show();
                     $('#Button').hide();
                 }
                 else if (data.value == '3') {
-                    $('#Titles').hide();
+                    $('#Titles').show();
                     $('#BgPics').show();
                     $('#Button').hide();
                 }

+ 76 - 67
Areas/Admin/Views/MainServer/MsgAlert/Edit.cshtml

@@ -5,7 +5,7 @@
 @{
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
-
+    string makerInfo = ViewBag.makerInfo as string;
 }
 <!DOCTYPE html>
 <html>
@@ -56,12 +56,12 @@
                                 </div>
                             </div>
                             @* <div class="layui-form-item layui-form-text">
-                                <label class="layui-form-label">简介</label>
-                                <div class="layui-input-block">
-                                <textarea class="layui-textarea" id="Summary" name="Summary" maxlength="500"
-                                lay-verify="" placeholder="请输入简介">@editData.Summary</textarea>
-                                </div>
-                                </div> *@
+                            <label class="layui-form-label">简介</label>
+                            <div class="layui-input-block">
+                            <textarea class="layui-textarea" id="Summary" name="Summary" maxlength="500"
+                            lay-verify="" placeholder="请输入简介">@editData.Summary</textarea>
+                            </div>
+                            </div> *@
                             <div class="layui-form-item layui-form-text">
                                 <label class="layui-form-label">内容</label>
                                 <div class="layui-input-block">
@@ -97,60 +97,60 @@
                                         @if (!string.IsNullOrEmpty(editData.BgPic))
                                         {
                                             <img src="@(MySystem.OssHelper.Instance.SourceHost)@editData.BgPic"
-                                            class="layui-upload-img" style="max-width:85px; max-height:85px;"
-                                            onclick="showBigPic('@(MySystem.OssHelper.Instance.SourceHost)@editData.BgPic')">
+                                                class="layui-upload-img" style="max-width:85px; max-height:85px;"
+                                                onclick="showBigPic('@(MySystem.OssHelper.Instance.SourceHost)@editData.BgPic')">
                                         }
                                     </div>
                                 </div>
                             </div>
                             @* <div class="layui-form-item">
-                                <label class="layui-form-label">推送类型</label>
-                                <div class="layui-input-inline">
-                                <select id="PushType" name="PushType" lay-search="">
-                                <option value="">请选择</option>
-                                <option value="0">不推送</option>
-                                <option value="1">立即推送</option>
-                                <option value="2">定时推送</option>
-                                </select>
-                                <script>$("#PushType").val("@editData.PushType");</script>
-                                </div>
-                                </div>
-                                <div class="layui-form-item">
-                                <label class="layui-form-label">推送标记</label>
-                                <div class="layui-input-inline">
-                                <select id="PushFlag" name="PushFlag" lay-search="">
-                                <option value="">请选择</option>
-                                <option value="0">不推送</option>
-                                <option value="1">未推送</option>
-                                <option value="2">已推送</option>
-                                </select>
-                                <script>$("#PushFlag").val("@editData.PushFlag");</script>
-                                </div>
-                                </div>
-                                <div class="layui-form-item">
-                                <label class="layui-form-label">推送参数</label>
-                                <div class="layui-input-inline">
-                                <input class="layui-input" type="text" id="PushParam" name="PushParam"
-                                value="@editData.PushParam" maxlength="255" lay-verify="" autocomplete="off"
-                                placeholder="请输入推送参数">
-                                </div>
-                                </div>
-                                <div class="layui-form-item">
-                                <label class="layui-form-label">推送时间</label>
-                                <div class="layui-input-inline">
-                                <input class="layui-input" type="text" id="PushTime" name="PushTime"
-                                value="@(editData.PushTime == null ? "" : editData.PushTime.Value.ToString("yyyy-MM-dd
-                                HH:mm:ss"))"
-                                lay-verify="" autocomplete="off" placeholder="请输入推送时间">
-                                </div>
-                                </div>
-                                <div class="layui-form-item layui-form-text">
-                                <label class="layui-form-label">扩展字段</label>
-                                <div class="layui-input-block">
-                                <textarea class="layui-textarea" id="ExtendColumn" name="ExtendColumn" maxlength=""
-                                lay-verify="" placeholder="请输入扩展字段">@editData.ExtendColumn</textarea>
-                                </div>
-                                </div> *@
+                            <label class="layui-form-label">推送类型</label>
+                            <div class="layui-input-inline">
+                            <select id="PushType" name="PushType" lay-search="">
+                            <option value="">请选择</option>
+                            <option value="0">不推送</option>
+                            <option value="1">立即推送</option>
+                            <option value="2">定时推送</option>
+                            </select>
+                            <script>$("#PushType").val("@editData.PushType");</script>
+                            </div>
+                            </div>
+                            <div class="layui-form-item">
+                            <label class="layui-form-label">推送标记</label>
+                            <div class="layui-input-inline">
+                            <select id="PushFlag" name="PushFlag" lay-search="">
+                            <option value="">请选择</option>
+                            <option value="0">不推送</option>
+                            <option value="1">未推送</option>
+                            <option value="2">已推送</option>
+                            </select>
+                            <script>$("#PushFlag").val("@editData.PushFlag");</script>
+                            </div>
+                            </div>
+                            <div class="layui-form-item">
+                            <label class="layui-form-label">推送参数</label>
+                            <div class="layui-input-inline">
+                            <input class="layui-input" type="text" id="PushParam" name="PushParam"
+                            value="@editData.PushParam" maxlength="255" lay-verify="" autocomplete="off"
+                            placeholder="请输入推送参数">
+                            </div>
+                            </div>
+                            <div class="layui-form-item">
+                            <label class="layui-form-label">推送时间</label>
+                            <div class="layui-input-inline">
+                            <input class="layui-input" type="text" id="PushTime" name="PushTime"
+                            value="@(editData.PushTime == null ? "" : editData.PushTime.Value.ToString("yyyy-MM-dd
+                            HH:mm:ss"))"
+                            lay-verify="" autocomplete="off" placeholder="请输入推送时间">
+                            </div>
+                            </div>
+                            <div class="layui-form-item layui-form-text">
+                            <label class="layui-form-label">扩展字段</label>
+                            <div class="layui-input-block">
+                            <textarea class="layui-textarea" id="ExtendColumn" name="ExtendColumn" maxlength=""
+                            lay-verify="" placeholder="请输入扩展字段">@editData.ExtendColumn</textarea>
+                            </div>
+                            </div> *@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">跳转Url参数</label>
                                 <div class="layui-input-inline">
@@ -186,22 +186,23 @@
                                 <label class="layui-form-label">是否周末</label>
                                 <div class="layui-input-inline">
                                     <input type="checkbox" id="IsWeekend" name="IsWeekend" value="1"
-                                        @(editData.IsWeekend == 1 ? "checked=checked" : "") lay-skin="switch"
+                                    @(editData.IsWeekend == 1 ? "checked=checked" : "") lay-skin="switch"
                                         lay-filter="switchTest" title="开关">
                                 </div>
                             </div>
-                            <div class="layui-form-item" id="MakerCode" style="display: none;">
-                                <label class="layui-form-label">指定推送</label>
+                            <div class="layui-form-item">
+                                <label class=" layui-form-label">指定推送</label>
                                 <div class="layui-input-inline">
                                     <input type="checkbox" id="AlertFlag" name="AlertFlag" value="1"
-                                        @(editData.AlertFlag == 1 ? "checked=checked" : "") lay-skin="switch"
+                            @(editData.AlertFlag == 1 ? "checked=checked" : "") lay-skin="switch"
                                         lay-filter="AlertFlag" title="开关">
                                 </div>
                             </div>
-                            <div class="layui-form-item">
-                                <label class="layui-form-label">创客编号</label>
+                            <div class="layui-form-item" id="MakerCode" style="display: none;">
+                                <label class="layui-form-label">指定推送创客编号</label>
                                 <div class="layui-input-block">
-                                    <textarea class="layui-textarea" lay-verify="" name="MakerCodes" id="MakerCodes" placeholder="请输入创客编号,多个创客编号用回车隔开"></textarea>
+                                    <textarea class="layui-textarea" lay-verify="" name="MakerCodes"
+                                        id="MakerCodes" placeholder="请输入创客编号,多个创客编号用回车隔开">@makerInfo</textarea>
                                 </div>
                             </div>
 
@@ -223,13 +224,13 @@
     <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script>
         //内容
-        @(Html.Raw(Library.Control.kindeditorVar("Content")))
+                                    @(Html.Raw(Library.Control.kindeditorVar("Content")))
 
 
             //编辑器
             KindEditor.ready(function (K) {
                 //内容
-        @(Html.Raw(Library.Control.kindeditor("Content", 1)))
+                                    @(Html.Raw(Library.Control.kindeditor("Content", 1)))
 
         });
 
@@ -385,11 +386,11 @@
                 $('#BgPics').hide();
                 $('#Button').show();
             } else if (MsgType == '2') {
-                $('#Titles').hide();
+                $('#Titles').show();
                 $('#BgPics').show();
                 $('#Button').hide();
             } else if (MsgType == '3') {
-                $('#Titles').hide();
+                $('#Titles').show();
                 $('#BgPics').show();
                 $('#Button').hide();
             }
@@ -403,6 +404,14 @@
                 }
                 form.render();
             });
+            var AlertFlag = '@editData.AlertFlag';
+            if (AlertFlag == '1') {
+                $('#MakerCode').show();
+            }
+            else
+            {
+                $('#MakerCode').hide();
+            }
 
             //日期
             laydate.render({

+ 134 - 0
Areas/Admin/Views/MainServer/SetMerchantTypeRecord/Index.cshtml

@@ -0,0 +1,134 @@
+@{
+    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: 115px !important;
+        }
+        .layui-inline{
+            margin-right: 0px !important;
+        }
+        .w100{
+            width: 100px !important;
+        }
+        .ml50{
+            margin-left: 50px !important;
+        }
+        tbody .layui-table-cell{
+            height: 60px !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">机具SN</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="PosSn" placeholder="" 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="MerUserTypeMakerCode" placeholder=""
+                                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="PosFromMakerCode" placeholder=""
+                                autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">操作类别</label>
+                        <div class="layui-input-inline">
+                            <select id="OperateTypeSelect" name="OperateTypeSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="1">设置</option>
+                                <option value="2">取消</option>
+                            </select>
+                        </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>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                </script>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">模板下载</label>
+                <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 37 - 29
Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml

@@ -1,20 +1,23 @@
 @{
     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">
+    <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">
@@ -38,9 +41,8 @@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="PosSn"
-                                            name="PosSn" maxlength="50" lay-verify="required|"
-                                            autocomplete="off" placeholder="请输入机具SN">
+                                        <input class="layui-input" type="text" id="PosSn" name="PosSn" maxlength="50"
+                                            lay-verify="required|" autocomplete="off" placeholder="请输入机具SN">
                                     </div>
                                 </div>
                                 <div class="layui-form-item">
@@ -65,7 +67,8 @@
     </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/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>
@@ -74,26 +77,30 @@
                 shade: [0.5, '#000']
             });
             var userdata = $("#confirmFrm").serialize();
-            $.ajax({
-                type: "POST",
-                url: "/Admin/SysTools/SetMerAgentDo?r=" + Math.random(1),
-                data: userdata,
-                dataType: "text",
-                success: function (data) {
-                    layer.close(index); //关闭弹层
-                    if (data == "success") {
-                        layer.msg("重置成功");
-                    } else {
-                        layer.msg(data);
+            var indexs = layer.confirm('确定要设置吗?', function (indexs) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/SysTools/CancelMerAgentDo?r=" + Math.random(1),
+                    data: userdata,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        layer.close(indexs); //关闭弹层
+                        if (data == "success") {
+                            layer.msg("取消成功");
+                            window.location.reload();
+                        } else {
+                            layer.msg(data);
+                        }
                     }
-                }
+                });
             });
         }
-        
-                    
+
+
         //编辑器
         KindEditor.ready(function (K) {
-            
+
         });
 
         var ids = "";
@@ -199,7 +206,7 @@
             });
         }
 
-        
+
         var tree;
         var element;
         var upload;
@@ -219,30 +226,31 @@
             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>

+ 9 - 0
Areas/Admin/Views/MainServer/SysTools/TransferPosCoupon.cshtml

@@ -30,6 +30,15 @@
                         </ul>
                         <div class="layui-tab-content mt20">
                             <div class="layui-tab-item layui-show">
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">券类型</label>
+                                    <div class="layui-input-inline">
+                                        <select id="Kind" name="Kind" lay-search="">
+                                            <option value="1">电签券</option>
+                                            <option value="2">大POS券</option>
+                                        </select>
+                                    </div>
+                                </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具券码</label>
                                     <div class="layui-input-block">

+ 13 - 0
Models/LeaderCompTmp.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderCompTmp
+    {
+        public int Id { get; set; }
+        public string EveryMonthData { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+    }
+}

+ 23 - 0
Models/MsgAlertUserList.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class MsgAlertUserList
+    {
+        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 int MsgId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 196 - 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<LeaderCompTmp> LeaderCompTmp { get; set; }
         public virtual DbSet<LeaderCompTradeStat> LeaderCompTradeStat { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
@@ -103,6 +104,7 @@ namespace MySystem.Models
         public virtual DbSet<Merchants> Merchants { get; set; }
         public virtual DbSet<MobileCodeCheck> MobileCodeCheck { get; set; }
         public virtual DbSet<MsgAlert> MsgAlert { get; set; }
+        public virtual DbSet<MsgAlertUserList> MsgAlertUserList { get; set; }
         public virtual DbSet<MsgBlackList> MsgBlackList { get; set; }
         public virtual DbSet<MsgPersonal> MsgPersonal { get; set; }
         public virtual DbSet<MsgPlacard> MsgPlacard { get; set; }
@@ -4260,7 +4262,130 @@ namespace MySystem.Models
                     .HasComment("排序序号");
 
                 entity.Property(e => e.StatMonth)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(20)")
+                    .HasComment("统计月份")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .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<LeaderCompTmp>(entity =>
+            {
+                entity.HasComment("领导人达标奖临时存储");
+
+                entity.Property(e => e.Id)
+                    .HasColumnType("int(11)")
+                    .HasComment("用户Id");
+
+                entity.Property(e => e.EveryMonthData)
+                    .HasColumnType("mediumtext")
+                    .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("上级创客");
+            });
+
+            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(20)")
                     .HasComment("统计月份")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
@@ -4269,6 +4394,10 @@ namespace MySystem.Models
                     .HasColumnType("int(11)")
                     .HasComment("状态");
 
+                entity.Property(e => e.TradeAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("当月交易额");
+
                 entity.Property(e => e.UpdateDate)
                     .HasColumnType("datetime")
                     .HasComment("更新时间");
@@ -6857,6 +6986,72 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MsgAlertUserList>(entity =>
+            {
+                entity.HasComment("系统弹窗消息创客关联表");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                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.MsgId)
+                    .HasColumnType("int(11)")
+                    .HasComment("弹窗消息");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .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.Status)
+                    .HasColumnType("int(11)")
+                    .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<MsgBlackList>(entity =>
             {
                 entity.HasComment("消息黑名单");

+ 10 - 13
wwwroot/layuiadmin/modules_main/MsgAlert_Admin.js

@@ -96,16 +96,17 @@ layui.config({
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'StatusName', width: 200, title: '状态', sort: true }
             , { field: 'Title', width: 200, title: '标题', sort: true }
-            , { field: 'Summary', width: 200, title: '简介', sort: true }
+            // , { field: 'Summary', width: 200, title: '简介', sort: true }
             // , { field: 'BgPic', width: 200, title: '背景图片', width: 60, templet: '#BgPicTpl', unresize: true }
             // , { field: 'PushType', width: 200, title: '推送类型', sort: true }
             // , { field: 'PushFlag', width: 200, title: '推送标记', sort: true }
             // , { field: 'PushTime', width: 200, title: '推送时间', sort: true }
             // , { field: 'UrlParam', width: 200, title: '跳转Url参数', sort: true }
-            , { field: 'BtnText', width: 200, title: '按钮文字', sort: true }
+            // , { field: 'BtnText', width: 200, title: '按钮文字', sort: true }
             , { field: 'TimeByDay', width: 200, title: '每日次数', sort: true }
             // , { field: 'AlertFlagName', width: 200, title: '弹窗标识', sort: true }
             , { field: 'IsWeekendName', width: 200, title: '是否周末', sort: true }
+            , { field: 'AlertFlagName', width: 200, title: '指定推送', sort: true }
 
             , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
             , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
@@ -168,11 +169,6 @@ layui.config({
 
                     //内容
                     iframeWindow.Contentedit.sync();
-
-
-
-
-
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
                         var field = data.field; //获取提交的字段
@@ -191,6 +187,7 @@ layui.config({
                             success: function (data) {
                                 layer.close(index); //关闭弹层
                                 if (data == "success") {
+                                    layer.msg("编辑成功");
                                     table.reload('LAY-list-manage'); //数据刷新
                                 } else {
                                     layer.msg(data);
@@ -287,11 +284,6 @@ layui.config({
 
                     //内容
                     iframeWindow.Contentedit.sync();
-
-
-
-
-
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
                         var field = data.field; //获取提交的字段
@@ -310,9 +302,14 @@ layui.config({
                             success: function (data) {
                                 layer.close(index); //关闭弹层
                                 if (data == "success") {
+                                    layer.msg("添加成功");
                                     table.reload('LAY-list-manage'); //数据刷新
                                 } else {
-                                    layer.msg(data);
+                                    layer.msg(data, {
+                                        time: 1500
+                                    }, function () {
+                                        table.reload('LAY-list-manage'); //数据刷新
+                                    });
                                 }
                             }
                         });

+ 409 - 0
wwwroot/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js

@@ -0,0 +1,409 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/SetMerchantTypeRecord/Import?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+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/SetMerchantTypeRecord/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/SetMerchantTypeRecord/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'PosSn', width: 200, title: 'SN编号', sort: true }
+            // , { field: 'BrandName', width: 200, title: '产品类型', sort: true }
+            , { field: 'OperateTypeName', width: 200, title: '操作类别', sort: true }
+            , { field: 'MerUserTypeName', width: 200, title: '商户型创客姓名', sort: true }
+            , { field: 'MerUserTypeMakerCode', width: 200, title: '商户型创客编码', sort: true }
+            , { field: 'PosFromName', width: 200, title: '机具所属创客姓名', sort: true }
+            , { field: 'PosFromMakerCode', width: 200, title: '机具所属创客编码', sort: true }
+            , { field: 'CreateDate', width: 200, title: '操作时间', sort: true }
+            , { field: 'SeoTitle', width: 200, title: '操作人', sort: true }
+        ]]
+        , 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;
+        if (obj.event === 'del') {
+            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/SetMerchantTypeRecord/Delete?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        if (data == "success") {
+                            obj.del();
+                            layer.close(index);
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        } else if (obj.event === 'edit') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '仓库库存变动记录-编辑'
+                , content: 'Edit?Id=' + data.Id + ''
+                , 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({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/SetMerchantTypeRecord/Edit?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');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    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 = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SetMerchantTypeRecord/Delete?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , 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({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/SetMerchantTypeRecord/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);
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
+        }
+        , 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/SetMerchantTypeRecord/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
+            });
+        }
+        , Open: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要开启的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要开启吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SetMerchantTypeRecord/Open?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , Close: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要关闭的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要关闭吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SetMerchantTypeRecord/Close?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});