ソースを参照

统计我的创客增量交易数据

lcl 1 年間 前
コミット
07f5ad3110

+ 15 - 2
AppStart/Helper/LeaderCompPrizeHelper.cs

@@ -31,7 +31,7 @@ namespace MySystem
                 {
                     if(DateTime.Now.Month == 1)
                     {                        
-                        CustomerSqlConn.op("insert into LeaderCompTradeStatBak select * from LeaderCompTradeStat;insert into LeaderCompTmpBak select * from LeaderCompTmp;insert into LeaderCompPrizeBak select * from LeaderCompPrize;", MysqlConn.SqlConnStr);
+                        CustomerSqlConn.op("insert into LeaderCompTradeStatBak select * from LeaderCompTradeStat;insert into LeaderCompTmpBak select * from LeaderCompTmp;insert into LeaderCompPrizeBak select * from LeaderCompPrize;insert into LeaderCompAddTradeBak select * from LeaderCompAddTrade;", MysqlConn.SqlConnStr);
                     }
                     Ready(DateTime.Now.ToString("yyyy-MM"));
                 }
@@ -47,7 +47,7 @@ namespace MySystem
 
         public void Ready(string curMonth)
         {
-            CustomerSqlConn.op("delete from LeaderCompTradeStat;delete from LeaderCompTmp;delete from LeaderCompPrize;", MysqlConn.SqlConnStr);
+            CustomerSqlConn.op("delete from LeaderCompTradeStat;delete from LeaderCompTmp;delete from LeaderCompPrize;delete from LeaderCompAddTrade;", MysqlConn.SqlConnStr);
             Thread.Sleep(10000);
             DateTime Start = DateTime.Parse("2023-06-01 00:00:00");
             DateTime now = DateTime.Parse(curMonth + "-01 00:00:00");
@@ -184,6 +184,19 @@ namespace MySystem
                             db.SaveChanges();
                         }
                     }
+                    LeaderCompAddTrade addTrade = db.LeaderCompAddTrade.FirstOrDefault(m => m.UserId == stat.UserId && m.StatMonth == MonthString);
+                    if(addTrade == null)
+                    {
+                        addTrade = db.LeaderCompAddTrade.Add(new LeaderCompAddTrade()
+                        {
+                            CreateDate = DateTime.Now,
+                            UserId = stat.UserId,
+                            StatMonth = MonthString,
+                        }).Entity;
+                        db.SaveChanges();
+                    }
+                    addTrade.AddTradeAmount = totalAmount;
+                    db.SaveChanges();
                     function.WriteLog(DateTime.Now.ToString() + "------" + stat.UserId, "领导人达标奖励日志");
                 }
                 function.WriteLog(DateTime.Now.ToString(), "领导人达标奖励日志");

+ 26 - 0
PxcModels/LeaderCompAddTrade.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class LeaderCompAddTrade
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public decimal AddTradeAmount { get; set; }
+        public int UserId { get; set; }
+        public string StatMonth { get; set; }
+    }
+}

+ 26 - 0
PxcModels/LeaderCompAddTradeBak.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class LeaderCompAddTradeBak
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public decimal AddTradeAmount { get; set; }
+        public int UserId { get; set; }
+        public string StatMonth { get; set; }
+    }
+}

+ 25 - 0
PxcModels/LeaderReconRecord.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class LeaderReconRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public decimal BalanceAmount { get; set; }
+        public decimal ReserveAmount { get; set; }
+        public string StatMonth { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 243 - 0
PxcModels/WebCMSEntities.cs

@@ -70,12 +70,15 @@ namespace MySystem.PxcModels
         public virtual DbSet<KqProductRuleSet> KqProductRuleSet { get; set; }
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
+        public virtual DbSet<LeaderCompAddTrade> LeaderCompAddTrade { get; set; }
+        public virtual DbSet<LeaderCompAddTradeBak> LeaderCompAddTradeBak { get; set; }
         public virtual DbSet<LeaderCompPrize> LeaderCompPrize { get; set; }
         public virtual DbSet<LeaderCompPrizeBak> LeaderCompPrizeBak { get; set; }
         public virtual DbSet<LeaderCompTmp> LeaderCompTmp { get; set; }
         public virtual DbSet<LeaderCompTmpBak> LeaderCompTmpBak { get; set; }
         public virtual DbSet<LeaderCompTradeStat> LeaderCompTradeStat { get; set; }
         public virtual DbSet<LeaderCompTradeStatBak> LeaderCompTradeStatBak { get; set; }
+        public virtual DbSet<LeaderReconRecord> LeaderReconRecord { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
@@ -4134,6 +4137,170 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<LeaderCompAddTrade>(entity =>
+            {
+                entity.HasComment("领导人达标奖增量");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AddTradeAmount)
+                    .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.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");
+
+                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<LeaderCompAddTradeBak>(entity =>
+            {
+                entity.HasComment("领导人达标奖增量bak");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AddTradeAmount)
+                    .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.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");
+
+                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<LeaderCompPrize>(entity =>
             {
                 entity.HasComment("领导人达标奖");
@@ -4586,6 +4753,82 @@ namespace MySystem.PxcModels
                     .HasComment("版本号");
             });
 
+            modelBuilder.Entity<LeaderReconRecord>(entity =>
+            {
+                entity.HasComment("盟主对账记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BalanceAmount)
+                    .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.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.ReserveAmount)
+                    .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");
+
+                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("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<LeaderReserveRecord>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");