Ejemplo n.º 1
0
        /// <summary>
        /// ES会员索引更新(批量)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateElasticIndexBluk(List <UserInfo> model)
        {
            if (model == null || !model.Any())
            {
                return(false);
            }
            var oUserBasics = new List <UserBasic>();

            foreach (var item in model)
            {
                var oUserBase = new UserBasic
                {
                    account_id = Convert.ToInt64(item.ShopId),
                    master_id  = Convert.ToInt64(item.MaxShopId),
                    user_id    = Convert.ToInt64(item.UserId),
                    user_name  = string.IsNullOrEmpty(item.Number) ? "" : item.Number.ToLower()
                };
                oUserBase.user_name     = string.IsNullOrEmpty(item.Name) ? "" : item.Name.ToLower();
                oUserBase.user_phone    = string.IsNullOrEmpty(item.Phone) ? "" : item.Phone.ToLower();
                oUserBase.user_pinyin   = string.IsNullOrEmpty(item.UPinYinFull) ? "" : item.UPinYinFull.ToLower();
                oUserBase.user_initials = string.IsNullOrEmpty(item.UPinYinShort) ? "" : item.UPinYinShort.ToLower();
                oUserBasics.Add(oUserBase);
            }

            var searchBasic = new SearchBasic();
            var bResult     = searchBasic.UserUpdateBluk(oUserBasics);

            return(bResult);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取会员搜索model
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public UserBasic GetUserSearchModel(UserInfo model)
        {
            var userBasic = new UserBasic
            {
                account_id    = Convert.ToInt64(model.ShopId),
                master_id     = Convert.ToInt64(model.MaxShopId),
                user_id       = Convert.ToInt64(model.UserId),
                user_cardno   = model.Number.ToLower(),
                user_name     = model.Name.ToLower(),
                user_phone    = model.Phone.ToLower(),
                user_pinyin   = model.UPinYinFull.ToLower(),
                user_initials = model.UPinYinShort.ToLower()
            };

            return(userBasic);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 会员更新
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UserUpdate(UserBasic model)
 {
     return(_search.DocumentPut(model.user_id.ToString(), model));
 }