Эх сурвалжийг харах

增加激活机具返运营中心的额度
创客购买机具,盟主,返运营中心的额度

lichunlei 2 жил өмнө
parent
commit
c9c88a03f7

+ 89 - 3
AppStart/Helper/AlipayPayBack2Service.cs

@@ -205,10 +205,14 @@ namespace MySystem
                         {
                             //充值盟主储备金
                             OpReserve(db, order, order.UserId, order.TotalPrice, 1);
+                            Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
+                            OperateReserveBackFor(db, user.ParentUserId, order.TotalPrice);
                         }
                         if (pro.ProductId == 28) //购买小盟主,给上级大盟主返储备金
                         {
                             LeaderBack(db, order);
+                            Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
+                            OperateReserveBackFor(db, user.ParentUserId, order.TotalPrice);
                         }
                     }
 
@@ -422,6 +426,7 @@ namespace MySystem
                                                             }
                                                         }
                                                         db.SaveChanges();
+                                                        OperateReserveBack(puser.Id, order.TotalPrice);
                                                         OperateFlag = false;
                                                     }
                                                 }
@@ -829,7 +834,65 @@ namespace MySystem
 
 
         //操作运营中心额度
-        public void OperateAmountChange(OpModels.WebCMSEntities db, Orders order, int UserId, decimal Money, int OperateType, string Remark = "")
+        public void OperateReserveBackFor(WebCMSEntities maindb, int UserId, decimal Money)
+        {
+            OpModels.WebCMSEntities db = new OpModels.WebCMSEntities();
+            while(UserId > 0)
+            {
+                Users user = maindb.Users.FirstOrDefault(m => m.Id == UserId);
+                if(user != null)
+                {
+                    bool sys = db.SysAdmin.Any(m => m.UserId == UserId);
+                    if(sys)
+                    {
+                        OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId) ?? new OpModels.UserAccount();
+                        if(account.TotalAmt <= 0)
+                        {
+                            return;
+                        }
+                        if(account.TotalAmt < Money)
+                        {
+                            Money = account.TotalAmt;
+                        }
+                        if(Money > 0)
+                        {
+                            OperateAmountChange(db, UserId, Money, 2, 1, "商城购机");
+                            OperateAmountChange(db, UserId, Money, 1, 2, "商城购机");
+                        }
+                        UserId = 0;
+                    }
+                    else
+                    {
+                        UserId = user.ParentUserId;
+                    }
+                }
+                else
+                {
+                    UserId = 0;
+                }
+            }
+            db.Dispose();
+        }
+        public void OperateReserveBack(int UserId, decimal Money)
+        {
+            OpModels.WebCMSEntities db = new OpModels.WebCMSEntities();
+            OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId) ?? new OpModels.UserAccount();
+            if(account.TotalAmt <= 0)
+            {
+                return;
+            }
+            if(account.TotalAmt < Money)
+            {
+                Money = account.TotalAmt;
+            }
+            if(Money > 0)
+            {
+                OperateAmountChange(db, UserId, Money, 2, 1, "商城购机");
+                OperateAmountChange(db, UserId, Money, 1, 2, "商城购机");
+            }
+            db.Dispose();
+        }
+        public void OperateAmountChange(OpModels.WebCMSEntities db, int UserId, decimal Money, int OperateType, int AmountType, string Remark = "")
         {
             OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
             if (account == null)
@@ -844,11 +907,33 @@ namespace MySystem
             decimal BeforeAmount = account.ValidAmount; //变更前总金额
             if(OperateType == 1)
             {
-                account.ValidAmount += Money;
+                if(AmountType == 1)
+                {
+                    account.TotalAmt += Money;
+                }
+                else if(AmountType == 1)
+                {
+                    account.ValidForGetAmount += Money;
+                }
+                else
+                {
+                    account.ValidAmount += Money;
+                }
             }
             else
             {
-                account.ValidAmount -= Money;
+                if(AmountType == 1)
+                {
+                    account.TotalAmt -= Money;
+                }
+                else if(AmountType == 1)
+                {
+                    account.ValidForGetAmount -= Money;
+                }
+                else
+                {
+                    account.ValidAmount -= Money;
+                }
             }
             decimal AfterAmount = account.ValidAmount; //变更后总金额
             OpModels.AmountRecord add = db.AmountRecord.Add(new OpModels.AmountRecord()
@@ -861,6 +946,7 @@ namespace MySystem
                 UseAmount = Money,
                 UserId = UserId,
                 SeoDescription = Remark,
+                Version = AmountType,
             }).Entity;
             db.SaveChanges();
         }

+ 8 - 0
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -297,6 +297,14 @@ namespace MySystem
                                             if(pos.OpId > 0)
                                             {
                                                 RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
+                                                if(pos.BrandId == 3 || pos.BrandId == 5 || pos.BrandId == 9)
+                                                {
+                                                    AlipayPayBack2Service.Instance.OperateReserveBack(pos.OpId, 150);
+                                                }
+                                                else
+                                                {
+                                                    AlipayPayBack2Service.Instance.OperateReserveBack(pos.OpId, 100);
+                                                }
                                             }
                                         }
                                         // 立刷60天内刷满10000,再返40

+ 13 - 11
AppStart/Timer/StoreApplyHelper.cs

@@ -31,7 +31,6 @@ public class StoreApplyHelper
         while (true)
         {
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
             try
             {
                 if(DateTime.Now.Day == 1 && DateTime.Now.Hour > 0 && DateTime.Now.Hour < 3)
@@ -83,19 +82,22 @@ public class StoreApplyHelper
         }
     }
 
-    private void DoSomething(WebCMSEntities db, int UId = 0)
+    public void DoSomething(WebCMSEntities db, int UId = 0)
     {
+        string connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
         Dictionary<int, decimal> dataDic = new Dictionary<int, decimal>();
         string pre = DateTime.Now.AddMonths(-2).ToString("yyyy-MM") + "-01 00:00:00";
         string start = DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00";
         string end = DateTime.Parse(start).AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss");
         string condition = "";
+        string usercondition = "";
         if(UId > 0)
         {
             condition = " and StoreId in (select Id from StoreHouse where UserId=" + UId + ")";
+            usercondition = " and UserId=" + UId;
         }
         //上月出货额度
-        DataTable dt = OtherMySqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (1,2,4,6,7,8) and TransType in (10,11,2) and StoreId>0" + condition + " group by StoreId");
+        DataTable dt = CustomerSqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (1,2,4,6,7,8) and TransType in (10,11,2) and StoreId>0" + condition + " group by StoreId", connstr);
         foreach(DataRow dr in dt.Rows)
         {
             int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
@@ -111,7 +113,7 @@ public class StoreApplyHelper
                 dataDic[store.UserId] += AmountMore;
             }
         }
-        dt = OtherMySqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (3,5,9) and TransType in (10,11,2) and StoreId>0" + condition + " group by StoreId");
+        dt = CustomerSqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (3,5,9) and TransType in (10,11,2) and StoreId>0" + condition + " group by StoreId", connstr);
         foreach(DataRow dr in dt.Rows)
         {
             int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
@@ -133,7 +135,7 @@ public class StoreApplyHelper
         {
             ids += "," + UserId;
         }
-        DataTable dts = OtherMySqlConn.dtable("select distinct UserId from StoreHouse where UserId not in (" + ids + ") and Status>-1");
+        DataTable dts = CustomerSqlConn.dtable("select distinct UserId from StoreHouse where UserId not in (" + ids + ")" + usercondition + " and Status>-1", connstr);
         foreach(DataRow dr in dts.Rows)
         {
             int UserId = int.Parse(function.CheckInt(dr[0].ToString()));
@@ -163,36 +165,36 @@ public class StoreApplyHelper
             }
             //被担保额度
             decimal PromissAmount = 0;
-            dt = OtherMySqlConn.dtable("select PromissAmount from StoreHouseAmountPromiss where ToUserId=" + UserId + " and Status=1");
+            dt = CustomerSqlConn.dtable("select PromissAmount from StoreHouseAmountPromiss where ToUserId=" + UserId + " and Status=1", connstr);
             foreach(DataRow dr in dt.Rows)
             {
                 PromissAmount += decimal.Parse(function.CheckNum(dr["PromissAmount"].ToString()));
             }
             decimal AmountMore = 0;
             //仓库中机具占用额度+小分仓机具占用额度
-            DataTable dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1");
+            DataTable dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
-            dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1");
+            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
             //除开小分仓中带“授”标记机具占用额度
-            dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (1,2,4,6,7,8) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2");
+            dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (1,2,4,6,7,8) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
-            dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (3,5,9) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2");
+            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (3,5,9) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
             //申请补货订单占用额度
-            dt = OtherMySqlConn.dtable("select UseAmount from StoreMachineApply where UserId=" + UserId + " and Status=0");
+            dt = CustomerSqlConn.dtable("select UseAmount from StoreMachineApply where UserId=" + UserId + " and Status=0", connstr);
             foreach(DataRow dr in dt.Rows)
             {
                 AmountMore += decimal.Parse(function.CheckNum(dr["UseAmount"].ToString()));

+ 7 - 0
Controllers/HomeController.cs

@@ -1262,5 +1262,12 @@ namespace MySystem.Controllers
             return "ok";
         }
     
+
+        public string test3()
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            StoreApplyHelper.Instance.DoSomething(db, 89);
+            return "ok";
+        }
     }
 }

+ 1 - 0
Models/PosMachinesTwo.cs

@@ -53,5 +53,6 @@ namespace MySystem.Models
         public ulong DownFeeFlag { get; set; }
         public ulong UpFeeFlag { get; set; }
         public int OpId { get; set; }
+        public int OpReserveKind { get; set; }
     }
 }

+ 2 - 0
Models/WebCMSEntities.cs

@@ -8611,6 +8611,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpReserveKind).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PosSn)

+ 22 - 0
OpModels/StoreActMerDaySummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreActMerDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreActMerMonthSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreActMerMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreSendDaySummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreSendDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreSendMonthSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreSendMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 2 - 0
OpModels/UserAccount.cs

@@ -26,5 +26,7 @@ namespace MySystem.OpModels
         public decimal FreezeAmount { get; set; }
         public decimal TotalAmt { get; set; }
         public int UserId { get; set; }
+        public decimal PosCouponApplyAmount { get; set; }
+        public decimal ValidForGetAmount { get; set; }
     }
 }

+ 175 - 3
OpModels/WebCMSEntities.cs

@@ -45,8 +45,12 @@ namespace MySystem.OpModels
         public virtual DbSet<RightDic> RightDic { get; set; }
         public virtual DbSet<SendDaySummary> SendDaySummary { get; set; }
         public virtual DbSet<SendMonthSummary> SendMonthSummary { get; set; }
+        public virtual DbSet<StoreActMerDaySummary> StoreActMerDaySummary { get; set; }
+        public virtual DbSet<StoreActMerMonthSummary> StoreActMerMonthSummary { get; set; }
         public virtual DbSet<StoreForOperate> StoreForOperate { get; set; }
         public virtual DbSet<StoreMachineApply> StoreMachineApply { get; set; }
+        public virtual DbSet<StoreSendDaySummary> StoreSendDaySummary { get; set; }
+        public virtual DbSet<StoreSendMonthSummary> StoreSendMonthSummary { get; set; }
         public virtual DbSet<SysAdmin> SysAdmin { get; set; }
         public virtual DbSet<SysAdminRole> SysAdminRole { get; set; }
         public virtual DbSet<SysLog> SysLog { get; set; }
@@ -105,7 +109,7 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TradeDate)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(8)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -1337,7 +1341,7 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TradeDate)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(8)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -1906,7 +1910,7 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TradeDate)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(8)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -1973,6 +1977,88 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<StoreActMerDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                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)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreActMerMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                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)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<StoreForOperate>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2079,6 +2165,88 @@ namespace MySystem.OpModels
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<StoreSendDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).HasColumnType("int(11)");
+
+                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)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreSendMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).HasColumnType("int(11)");
+
+                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)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<SysAdmin>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2464,6 +2632,8 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.FreezeAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.PosCouponApplyAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -2500,6 +2670,8 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.ValidAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.ValidForGetAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.Version).HasColumnType("int(11)");
 
                 entity.Property(e => e.WithdrawAmount).HasColumnType("decimal(18,2)");

+ 1 - 0
PxcModels/PosMachinesTwo.cs

@@ -53,5 +53,6 @@ namespace MySystem.PxcModels
         public ulong DownFeeFlag { get; set; }
         public ulong UpFeeFlag { get; set; }
         public int OpId { get; set; }
+        public int OpReserveKind { get; set; }
     }
 }

+ 2 - 0
PxcModels/WebCMSEntities.cs

@@ -8611,6 +8611,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpReserveKind).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PosSn)

+ 2 - 2
Startup.cs

@@ -106,11 +106,11 @@ namespace MySystem
             MySystemLib.SystemPublicFuction.checkurl = checkurl;
             MySystemLib.SystemPublicFuction.appcheck = "success";
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
-            System.Data.DataTable tablecollection = Library.dbconn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'");
+            System.Data.DataTable tablecollection = Library.dbconn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer2'");
             foreach (System.Data.DataRow subtable in tablecollection.Rows)
             {
                 Dictionary<string, string> Columns = new Dictionary<string, string>();
-                System.Data.DataTable columncollection = Library.dbconn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                System.Data.DataTable columncollection = Library.dbconn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer2' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();