Exemple #1
0
        /// <summary>
        /// 获取微信用户信息列表
        /// </summary>
        /// <returns></returns>
        public List <WeixinUserInfoEntity> GetEntities()
        {
            var entities   = new WeixinUserInfoDll().LoadEntities(p => p.OpenId != "").ToList();
            var viewEntity = new WeixinUserInfoEntity();

            return(entities.Select(p => viewEntity.GetViewModel(p)).ToList());
        }
 /// <summary>
 /// 获取渠道的扫描记录
 /// </summary>
 /// <param name="channelId">渠道ID</param>
 /// <returns></returns>
 public List<ChannelScanDisplayEntity> GetChannelScanList(int channelId)
 {
     //获取渠道扫描记录
     var entities = new ChannelScanDll().LoadEntities(p => p.ChannelId == channelId).ToList();
     var viewEntity = new ChannelScanEntity();
     var result = entities.Select(p => new ChannelScanDisplayEntity() { ScanEntity = viewEntity.GetViewModel(p) }).ToList();
     //获取每条渠道扫描记录对应的微信用户信息
     var openIds = result.Select(p=>p.ScanEntity.OpenId).ToArray();
     //在渠道扫描记录中包含微信用户信息,便于前端页面显示
     var userinfoEntities = new WeixinUserInfoDll().LoadEntities(p => openIds.Contains(p.OpenId)).ToList();
     var userinfoViewEntity = new WeixinUserInfoEntity();
     var userinfoViewEnities = userinfoEntities.Select(p => userinfoViewEntity.GetViewModel(p)).ToList();
     result.ForEach(e=>{
         e.UserInfoEntity = userinfoViewEnities.Where(p => p.OpenId == e.ScanEntity.OpenId).FirstOrDefault();
     });
     return result;
 }
Exemple #3
0
        /// <summary>
        /// 获取渠道的扫描记录
        /// </summary>
        /// <param name="channelId">渠道ID</param>
        /// <returns></returns>
        public List <ChannelScanDisplayEntity> GetChannelScanList(int channelId)
        {
            //获取渠道扫描记录
            var entities   = new ChannelScanDll().LoadEntities(p => p.ChannelId == channelId).ToList();
            var viewEntity = new ChannelScanEntity();
            var result     = entities.Select(p => new ChannelScanDisplayEntity()
            {
                ScanEntity = viewEntity.GetViewModel(p)
            }).ToList();
            //获取每条渠道扫描记录对应的微信用户信息
            var openIds = result.Select(p => p.ScanEntity.OpenId).ToArray();
            //在渠道扫描记录中包含微信用户信息,便于前端页面显示
            var userinfoEntities    = new WeixinUserInfoDll().LoadEntities(p => openIds.Contains(p.OpenId)).ToList();
            var userinfoViewEntity  = new WeixinUserInfoEntity();
            var userinfoViewEnities = userinfoEntities.Select(p => userinfoViewEntity.GetViewModel(p)).ToList();

            result.ForEach(e => {
                e.UserInfoEntity = userinfoViewEnities.Where(p => p.OpenId == e.ScanEntity.OpenId).FirstOrDefault();
            });
            return(result);
        }
 /// <summary>
 /// 获取微信用户信息列表
 /// </summary>
 /// <returns></returns>
 public List<WeixinUserInfoEntity> GetEntities()
 {
     var entities = new WeixinUserInfoDll().LoadEntities(p => p.OpenId != "").ToList();
     var viewEntity = new WeixinUserInfoEntity();
     return entities.Select(p => viewEntity.GetViewModel(p)).ToList();
 }