/// <summary> /// 活动报名列表 /// </summary> /// <param name="eid"></param> /// <param name="lt"></param> /// <param name="page"></param> /// <param name="count"></param> /// <returns></returns> public ActionResult SignInList(int eid, int lt = -1, int page = 1, int count = 10) { var model = ActivesBussiness.GetActivesModel(eid); PageFliter pageFliter = new PageFliter(); pageFliter.PageIndex = page; pageFliter.PageSize = count; var list = SignInRecordBussiness.GetSignInRecordsByActiveID(eid, lt, pageFliter); return(Success(new { items = list.Select(m => new { name = m.CreateUserName, verified = m.Status ?? 0, head_img = m.CreateUserAvatars, user_visible = 1, info_id = m.ID, date_str = m.CreateTime.Value.ToString("yyyy-MM-dd HH:mm"), last_update = LeoUtils.ConvertDateTimeInt1(m.UpdateTime.Value) }), total = pageFliter.TotalCount, endCount = pageFliter.TotalPage, info_id = 0 })); }
public List <SignInRecordModel> GetAllSignInRecord(int eid, PageFliter pageFliter) { string sql = $@"select t2.*, (select cast(ID as nvarchar(64))+'!|' from CustomField where t2.ActiveID=ActiveID order by Sort asc for xml Path('')) as fieldKeys, (select [Name]+'!|' from CustomField where t2.ActiveID=ActiveID order by Sort asc for xml Path('')) as fieldNames, (select cast(t1.[Value] as nvarchar(max))+'!|' from CustomField t left join CustomFieldValue t1 on t.ID=t1.CustomFieldID where t2.ActiveID=t.ActiveID and t1.SignInID=t2.ID for xml Path('')) as fieldVals, t3.UserName CreateUserName from SignInRecord t2 left join [User] t3 on t2.CreateUserID=t3.ID where t2.ActiveID={eid} order by t2.CreateTime desc"; return(Context.FromSql(sql).ToList <SignInRecordModel>().GetPage(pageFliter)); }
public List <ActivesModel> GetList(int type, int userid, PageFliter pageFliter) { string sql = ""; if (type == 0) { sql = $"select * from Actives where CreateUserID={userid} order by CreateTime desc "; } else if (type == 1) { sql = $"select * from Actives t where exists(select 1 from SignInRecord where ActiveID=t.ID and CreateUserID={userid}) order by CreateTime desc "; } else if (type == 2) { sql = $"select * from Actives t where exists(select 1 from FavoriteActives where ActiveID=t.ID and CreateUserID={userid}) order by CreateTime desc "; } return(Context.FromSql(sql).ToList <ActivesModel>().GetPage(pageFliter).OrderByDescending(m => m.CreateTime).ToList()); }
/// <summary> /// 获取我的活动列表 /// </summary> /// <param name="type"></param> /// <param name="page"></param> /// <param name="count"></param> /// <returns></returns> public ActionResult GetActives(int type = 0, int page = 1, int count = 10) { PageFliter pageFliter = new PageFliter(); pageFliter.PageSize = count; pageFliter.PageIndex = page; var list = ActivesBussiness.GetList(type, LoginUserInfo.ID, pageFliter); return(Success(list.Select(m => new { title = m.Title, eid = m.ID, banner = m.Img, user_visible = m.ListReportPermission, count = m.SignInCount, limit = m.SignIntMaxCount, fee = (m.CollectFees / m.SignIntMaxCount) * 100, charge = 0, has_balance = string.IsNullOrEmpty(m.Img) ? 0 : 1, status = m.SigninEndTime <= DateTime.Now ? 2 : m.SigninBeginTIme <= DateTime.Now ? 1: 0 }), "enrollList")); }
public JsonResult user_all(int eid, int page, int count) { PageFliter pageFliter = new PageFliter() { PageIndex = page, PageSize = count }; var list = SignInRecordBussiness.GetAllSignInRecord(eid, pageFliter); List <VM_Feild> field_list = new List <VM_Feild>(); var customs = CustomFieldBussiness.GetCustomFieldModels(m => m.ActiveID == eid); field_list.Add(new VM_Feild() { field_key = "XWNo", field_name = "微信名称" }); foreach (var item in customs) { VM_Feild feild = new VM_Feild(); feild.field_key = item.ID.ToString(); feild.field_name = item.Name; field_list.Add(feild); } field_list.Add(new VM_Feild() { field_key = "Status", field_name = "报名状态" }); field_list.Add(new VM_Feild() { field_key = "isHeXiao", field_name = "是否核销" }); field_list.Add(new VM_Feild() { field_key = "Desc", field_name = "备注说明" }); field_list.Add(new VM_Feild() { field_key = "SignInTime", field_name = "报名时间" }); ArrayList user_infos = new ArrayList(); foreach (var item in list) { var keys = item.fieldKeys.SplitExtension("!|", StringSplitOptions.None); var names = item.fieldNames.SplitExtension("!|", StringSplitOptions.None); var vals = item.fieldVals.SplitExtension("!|", StringSplitOptions.None); List <VM_Feild> feilds = new List <VM_Feild>(); feilds.Add(new VM_Feild() { field_key = "XWNo", field_name = "微信名称", field_value = item.CreateUserName }); for (int i = 0; i < keys.Length; i++) { VM_Feild feild = new VM_Feild(); feild.field_key = keys[i]; feild.field_name = names.Count() >= i ? names[i]:""; feild.field_value = vals.Count() >= i? vals[i]:""; feilds.Add(feild); } feilds.Add(new VM_Feild() { field_key = "Status", field_name = "报名状态", field_value = item.Status == 1 ? "已审核" : item.Status == 2 ? "驳回" : "未审核" }); feilds.Add(new VM_Feild() { field_key = "isHeXiao", field_name = "是否核销", field_value = "未核销" }); feilds.Add(new VM_Feild() { field_key = "Desc", field_name = "备注说明", field_value = item.Remark }); feilds.Add(new VM_Feild() { field_key = "SignInTime", field_name = "报名时间", field_value = item.CreateTime.Value.ToString("yyyy-MM-dd HH:mm") }); user_infos.Add(feilds); } return(Success(new { field_list, user_infos })); }
public static List <SignInRecordModel> GetAllSignInRecord(int eid, PageFliter pageFliter) { return(SignInRecordDAL.dal.GetAllSignInRecord(eid, pageFliter)); }
public static List <SignInRecordModel> GetSignInRecordsByActiveID(int ActiveID, int type, PageFliter pageFliter) { return(SignInRecordDAL.dal.GetSignInRecordsByActiveID(ActiveID, type, pageFliter)); }
public static List <ActiveManagesModel> GetList(int type, int userid, PageFliter pageFliter) { return(ActiveManagesDAL.dal.GetList(type, userid, pageFliter)); }
public List <SignInRecordModel> GetSignInRecordsByActiveID(int ActiveID, int lt, PageFliter pageFliter) { string sql = $@" select t.*, t1.UserName CreateUserName, t1.Avatars CreateUserAvatars from SignInRecord t left join [User] t1 on t.CreateUserID=t1.ID where t.ActiveID={ActiveID} "; if (lt == -1) { sql += " order by t.CreateTime desc"; } else { sql += " order by t.UpdateTime desc"; } return(Context.FromSql(sql).ToList <SignInRecordModel>().GetPage(pageFliter)); }
public static List <AuditLogModel> GetList(int type, int userid, PageFliter pageFliter) { return(AuditLogDAL.dal.GetList(type, userid, pageFliter)); }