public async Task <BaseResult <UserApplyEntity> > GetById(string id) { if (string.IsNullOrEmpty(id)) { return(new BaseResult <UserApplyEntity>(808)); } Expression <Func <UserApplyEntity, bool> > where_serch = LinqUtil.True <UserApplyEntity>(); where_serch = where_serch.AndAlso(c => c.apply_id.Contains(id)); //调用仓储方法查询分页并且响应给前台 UserApplyEntity query = (from c in await userApplyRepository.GetAllAsync(where_serch) join o in await userRepository.GetAllAsync() on c.user_id equals o.user_id join n in await userRepository.GetAllAsync() on c.detail_id equals n.user_id into joinTemp from tmp in joinTemp.DefaultIfEmpty() select new UserApplyEntity() { //使用申请人用户Id和处理人用户Id返回用户邮箱信息 user_id = o.user_email, createtime = c.createtime, detail_id = tmp == null ? "" : tmp.full_name, apply_id = c.apply_id, apply_reason = c.apply_reason, apply_desc = c.apply_desc, row_number = c.row_number, is_true = c.is_true }).FirstOrDefault(); return(new BaseResult <UserApplyEntity>(200, query)); }
public async Task <BaseResult <bool> > Add(UserApplyEntity userApplyEntity) { var isTrue = await userApplyRepository.AddAsync(userApplyEntity); if (!isTrue) { return(new BaseResult <bool>(201, false)); } return(new BaseResult <bool>(200, true)); }
public async Task <IActionResult> UpdateApplyUser(string apply_reason) { UserApplyEntity userApplyEntity = new UserApplyEntity() { user_id = return_front_userid(), apply_reason = apply_reason }; var data = await userApplyService.Add(userApplyEntity); return(Json(data)); }