1234567891011121314151617181920212223242526272829303132 |
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- namespace EMIS.DataLogic.SystemDAL
- {
- public class WechatMPDAL
- {
- public WechatSubscribeRepository WechatSubscripbeRepository { get; set; }
- public RoleRepository RoleRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- public IQueryable<string> GetOpenIDList(Expression<Func<Sys_Role, bool>> roleExp, Expression<Func<Sys_User, bool>> userExp)
- {
- var sql = (from role in RoleRepository.GetList(roleExp)
- from user in role.Sys_User
- from openid in WechatSubscripbeRepository.Entities.Where(x => x.UserID == user.UserID)
- select openid.OpenID)
- .Union(
- from user in UserRepository.GetList(userExp)
- from openid in WechatSubscripbeRepository.Entities.Where(x => x.UserID == user.UserID)
- select openid.OpenID
- );
- return sql;
- }
- }
- }
|