liaoxujun@qq.com
2024-04-01 68bcb554b91c0da1b7765142cc95ba0b5ade1a5a
CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs
@@ -1,7 +1,7 @@
/***********************************************************************
 *            Project: CoreCms
 *            Project: baifenBinfa
 *        ProjectName: 百分兵法管理系统                               
 *                Web: hhtp://chuanyin.com
 *                Web: http://chuanyin.com
 *             Author:                                        
 *              Email:                               
 *         CreateTime: 202403/02   
@@ -21,6 +21,7 @@
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Services;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using CoreCms.Net.Web.Admin.Infrastructure;
@@ -1443,5 +1444,34 @@
        }
        #endregion
        #region 设置是否成为推广人员百分兵法
        /// <summary>
        /// 设置是否成为推广人员
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [HttpPost]
        [Description("设置是否成为推广人员")]
        public async Task<AdminUiCallBack> DoSetIsBaiFenBingfaP([FromBody] FMUpdateBoolDataByIntId entity)
        {
            var jm = new AdminUiCallBack();
            var oldModel = await _coreCmsUserServices.QueryByIdAsync(entity.id);
            if (oldModel == null)
            {
                jm.msg = "不存在此信息";
                return jm;
            }
            oldModel.IsBaifenPromotion = entity.data;
            var bl = await _coreCmsUserServices.UpdateAsync(oldModel);
            jm.code = bl ? 0 : 1;
            jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
            return jm;
        }
        #endregion
    }
}