DuGuYang 3 anni fa
parent
commit
f3e6f1dd3c

+ 18 - 9
Areas/Admin/Controllers/MainServer/SchoolMorningMeetController.cs

@@ -51,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 商学院每日晨会列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(SchoolMorningMeet data, int page = 1, int limit = 30)
+        public JsonResult IndexData(SchoolMorningMeet data, string IsBannerSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -62,6 +62,10 @@ namespace MySystem.Areas.Admin.Controllers
 
 
             string condition = " and Status>-1";
+            if (!string.IsNullOrEmpty(IsBannerSelect))
+            {
+                condition += " and IsBanner=" + IsBannerSelect;
+            }
 
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SchoolMorningMeet", Fields, "Id desc", "0", page, limit, condition);
@@ -69,6 +73,7 @@ namespace MySystem.Areas.Admin.Controllers
             foreach (Dictionary<string, object> dic in diclist)
             {
                 dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
+                dic["IsBannerName"] = dic["IsBanner"].ToString() == "1" ? "是" : "否";
 
             }
             return Json(obj);
@@ -114,14 +119,16 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
+            Fields.Add("IsBanner", data.IsBanner); //首页每日晨会推荐
+            Fields.Add("BannerPhoto", data.BannerPhoto); //每日晨会Banner
             int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("SchoolMorningMeet", Fields, 0);
             AddSysLog(data.Id.ToString(), "SchoolMorningMeet", "add");
             db.SaveChanges();
-            var info =  db.SchoolMorningMeet.FirstOrDefault(m => m.Id == Id);
-            if(info != null)
+            var info = db.SchoolMorningMeet.FirstOrDefault(m => m.Id == Id);
+            if (info != null)
             {
-                info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value)/60;
-                info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value)/60;
+                info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value) / 60;
+                info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value) / 60;
                 db.SaveChanges();
             }
 
@@ -170,13 +177,15 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
+            Fields.Add("IsBanner", data.IsBanner); //首页每日晨会推荐
+            Fields.Add("BannerPhoto", data.BannerPhoto); //每日晨会Banner
             new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("SchoolMorningMeet", Fields, data.Id);
             AddSysLog(data.Id.ToString(), "SchoolMorningMeet", "update");
-            var info =  db.SchoolMorningMeet.FirstOrDefault(m => m.Id == data.Id);
-            if(info != null)
+            var info = db.SchoolMorningMeet.FirstOrDefault(m => m.Id == data.Id);
+            if (info != null)
             {
-                info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value)/60;
-                info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value)/60;
+                info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value) / 60;
+                info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value) / 60;
                 db.SaveChanges();
             }
 

+ 38 - 2
Areas/Admin/Views/MainServer/SchoolMorningMeet/Add.cshtml

@@ -113,9 +113,26 @@
                                         style="width:100%;height:500px;"></textarea>
                                 </div>
                             </div>
-
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">首页每日晨会推荐</label>
+                                <div class="layui-input-block">
+                                    <input type="checkbox" id="IsBanner" name="IsBanner" value="1"
+                                        lay-skin="switch" lay-filter="IsBanner" title="开关">
+                                </div>
+                            </div>
+                            <div class="layui-form-item" id="BannerList" style="display: none;">
+                                <label class="layui-form-label">Banner图片</label>
+                                <div class="layui-input-block">
+                                    <div class="layui-upload">
+                                        <input type="hidden" id="BannerPhoto" name="BannerPhoto" value="">
+                                        <button class="layui-btn" type="button" id="BannerBtn">选择图片</button>
+                                        <div class="layui-inline layui-word-aux">@(new MySystem.PublicFunction().GetUploadHint("SchoolMorningMeetBannerPhoto"))</div>
+                                    </div>
+                                    <div style="margin-top:10px;" id="BannerPhotoImage">
+                                    </div>
+                                </div>
+                            </div>
                         </div>
-
                     </div>
                 </div>
                 <div class="layui-form-item layui-hide">
@@ -273,6 +290,20 @@
                 location.hash = 'test=' + $(this).attr('lay-id');
             });
 
+            form.on('switch(IsBanner)', function (data) {
+                console.log(data);
+                if (this.checked) {
+                    $('#BannerList').css('display', 'block');
+                    $('#OutLink').css('display', 'block');
+                    $('#SortBanner').css('display', 'block');
+                } else {
+                    $('#BannerList').css('display', 'none');
+                    $('#OutLink').css('display', 'none');
+                    $('#SortBanner').css('display', 'none');
+                }
+                form.render();
+            });
+
             //日期
             laydate.render({
                 elem: '#PublishDate',
@@ -291,6 +322,11 @@
                 $('#Photo').val(filename);
             });
 
+            WebUploadJs('BannerBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload/v2', @(Html.Raw(new MySystem.PublicFunction().GetUploadParam("SchoolMorningMeetBannerPhoto"))), function (filename) {
+                $('#BannerPhotoImage').html('<img src="' + osshost + filename + '" class="layui-upload-img" style="max-width:85px; max-height:85px;" onclick="showBigPic(\'' + osshost + filename + '\')">')
+                $('#BannerPhoto').val(filename);
+            });
+
 
             //穿梭框
 

+ 47 - 4
Areas/Admin/Views/MainServer/SchoolMorningMeet/Edit.cshtml

@@ -71,8 +71,7 @@
                                     <div class="layui-upload">
                                         <input type="hidden" id="Photo" name="Photo" value="@editData.Photo">
                                         <button class="layui-btn" type="button" id="PhotoBtn">选择图片</button>
-                                        <div class="layui-inline layui-word-aux">@(new
-                                            MySystem.PublicFunction().GetUploadHint("SchoolMorningMeetPhoto"))</div>
+                                        <div class="layui-inline layui-word-aux">@(new MySystem.PublicFunction().GetUploadHint("SchoolMorningMeetPhoto"))</div>
                                     </div>
                                     <div style="margin-top:10px;" id="PhotoImage">
                                         @if (!string.IsNullOrEmpty(editData.Photo))
@@ -127,9 +126,33 @@
                                         style="width:100%;height:500px;">@(MySystem.OssHelper.Instance.CheckOSSPic(editData.Contents))</textarea>
                                 </div>
                             </div>
-
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">首页每日晨会推荐</label>
+                                <div class="layui-input-block">
+                                    <input type="checkbox" id="IsBanner" name="IsBanner" value="1"
+                                        @(editData.IsBanner == 1 ? "checked=checked" : "") lay-skin="switch" lay-filter="IsBanner" title="开关">
+                                </div>
+                            </div>
+                            <div class="layui-form-item" id="BannerList" style="display: none;">
+                                <label class="layui-form-label">Banner图片</label>
+                                <div class="layui-input-block">
+                                    <div class="layui-upload">
+                                        <input type="hidden" id="BannerPhoto" name="BannerPhoto"
+                                            value="@editData.BannerPhoto">
+                                        <button class="layui-btn" type="button" id="BannerBtn">选择图片</button>
+                                        <div class="layui-inline layui-word-aux">@(new MySystem.PublicFunction().GetUploadHint("SchoolMorningMeetBannerPhoto"))</div>
+                                    </div>
+                                    <div style="margin-top:10px;" id="BannerPhotoImage">
+                                        @if (!string.IsNullOrEmpty(editData.BannerPhoto))
+                                        {
+                                            <img src="@(MySystem.OssHelper.Instance.SourceHost)@editData.BannerPhoto"
+                                            class="layui-upload-img" style="max-width:85px; max-height:85px;"
+                                            onclick="showBigPic('@(MySystem.OssHelper.Instance.SourceHost)@editData.BannerPhoto')">
+                                        }
+                                    </div>
+                                </div>
+                            </div>
                         </div>
-
                     </div>
                 </div>
                 <div class="layui-form-item layui-hide">
@@ -286,6 +309,21 @@
                 location.hash = 'test=' + $(this).attr('lay-id');
             });
 
+            form.on('switch(IsBanner)', function (data) {
+                console.log(data);
+                if (this.checked) {
+                    $('#BannerList').css('display', 'block');
+                } else {
+                    $('#BannerList').css('display', 'none');
+                }
+                form.render();
+            });
+            var IsBanner = '@editData.IsBanner';
+            if(IsBanner == '1')
+            {
+                $('#BannerList').css('display', 'block');
+            }
+
             //日期
             laydate.render({
                 elem: '#PublishDate',
@@ -303,6 +341,11 @@
                 $('#Photo').val(filename);
             });
 
+            WebUploadJs('BannerBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload/v2', @(Html.Raw(new MySystem.PublicFunction().GetUploadParam("SchoolMorningMeetBannerPhoto"))), function (filename) {
+                $('#BannerPhotoImage').html('<img src="' + osshost + filename + '" class="layui-upload-img" style="max-width:85px; max-height:85px;" onclick="showBigPic(\'' + osshost + filename + '\')">')
+                $('#BannerPhoto').val(filename);
+            });
+
 
             //穿梭框
 

+ 20 - 0
Models/ChangeTypes.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ChangeTypes
+    {
+        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 string Name { get; set; }
+        public int Kind { get; set; }
+    }
+}

+ 26 - 0
Models/LeaderCompPrize.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderCompPrize
+    {
+        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 SecDirectCount { get; set; }
+        public int NotDirectCount { get; set; }
+        public int DirectCount { get; set; }
+        public int UserId { get; set; }
+        public string StatMonth { get; set; }
+    }
+}

+ 2 - 0
Models/SchoolMorningMeet.cs

@@ -23,5 +23,7 @@ namespace MySystem.Models
         public string Photo { get; set; }
         public string Lecturer { get; set; }
         public string Title { get; set; }
+        public ulong IsBanner { get; set; }
+        public string BannerPhoto { get; set; }
     }
 }

+ 2 - 0
Models/SetMerchantTypeRecord.cs

@@ -26,5 +26,7 @@ namespace MySystem.Models
         public string Note { get; set; }
         public int ToUserId { get; set; }
         public int FromUserId { get; set; }
+        public int OperateType { get; set; }
+        public int BuyUserId { get; set; }
     }
 }

+ 1 - 0
Models/UserAccountRecord.cs

@@ -29,5 +29,6 @@ namespace MySystem.Models
         public int ProductType { get; set; }
         public int ChangeType { get; set; }
         public int UserId { get; set; }
+        public int Kind { get; set; }
     }
 }

+ 141 - 3
Models/WebCMSEntities.cs

@@ -37,6 +37,7 @@ namespace MySystem.Models
         public virtual DbSet<BusinessPartnerMerchant> BusinessPartnerMerchant { get; set; }
         public virtual DbSet<BusinessPartnerPos> BusinessPartnerPos { get; set; }
         public virtual DbSet<BusinessTradeSummary> BusinessTradeSummary { get; set; }
+        public virtual DbSet<ChangeTypes> ChangeTypes { get; set; }
         public virtual DbSet<Col> Col { get; set; }
         public virtual DbSet<ConsumerOpenIds> ConsumerOpenIds { get; set; }
         public virtual DbSet<ConsumerOrderForNo> ConsumerOrderForNo { get; set; }
@@ -69,6 +70,7 @@ namespace MySystem.Models
         public virtual DbSet<KqProductRuleSet> KqProductRuleSet { get; set; }
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
+        public virtual DbSet<LeaderCompPrize> LeaderCompPrize { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
@@ -269,7 +271,7 @@ namespace MySystem.Models
         {
             if (!optionsBuilder.IsConfigured)
             {
-                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql")); 
+                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql"));
             }
         }
 
@@ -1979,6 +1981,43 @@ namespace MySystem.Models
                 entity.Property(e => e.VipFlag).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<ChangeTypes>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.Kind).HasColumnType("int(11)");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<Col>(entity =>
             {
                 entity.HasComment("分类设置");
@@ -4148,6 +4187,86 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<LeaderCompPrize>(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.DirectCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("直推达标人数");
+
+                entity.Property(e => e.NotDirectCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("简推达标人数");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.SecDirectCount)
+                    .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(6)")
+                    .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<LeaderReserveRecord>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -12267,6 +12386,12 @@ namespace MySystem.Models
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
+                entity.Property(e => e.BannerPhoto)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("Banner图例")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Contents)
                     .HasColumnType("longtext")
                     .HasCharSet("utf8")
@@ -12279,6 +12404,11 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.IsBanner)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'")
+                    .HasComment("Banner推荐");
+
                 entity.Property(e => e.Lecturer)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -12618,6 +12748,10 @@ namespace MySystem.Models
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.BuyUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("机具所属人");
+
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.CreditAmount).HasColumnType("decimal(18,2)");
@@ -12638,6 +12772,10 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OperateType)
+                    .HasColumnType("int(11)")
+                    .HasComment("操作类型");
+
                 entity.Property(e => e.PosSn)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -15296,8 +15434,6 @@ namespace MySystem.Models
 
             modelBuilder.Entity<UserAccount>(entity =>
             {
-                entity.HasComment("创客账户");
-
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.AccountStatus).HasColumnType("int(11)");
@@ -15428,6 +15564,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Kind).HasColumnType("int(11)");
+
                 entity.Property(e => e.ProductType).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");

+ 2 - 0
wwwroot/layuiadmin/modules_main/SchoolMorningMeet_Admin.js

@@ -97,6 +97,8 @@ layui.config({
             // , { field: 'StatusName', width: 200, title: '状态', sort: true }
             , { field: 'Lecturer', width: 200, title: '主讲', sort: true }
             , { field: 'StudyPerson', width: 200, title: '学习人数', sort: true }
+            , { field: 'IsBannerName', width: 150, title: '每日晨会推荐', sort: true }
+            // , { field: 'BannerPhoto', width: 150, title: 'Banner图片', templet: '#imgTpl', unresize: true, sort: true }
             // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
             , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]