예제 #1
0
            public static ItemEvaluation getItemEvaluationItem(SHLServiceClient.Entity.Items.ItemEvaluation data)
            {
                var result = new ItemEvaluation();

                if (data != null)
                {
                    result.totalNum = data.TotalNum;
                    result.goodNum  = data.GoodNum;
                    result.minNum   = data.MinNum;
                    result.badNum   = data.BadNum;
                    if (data.Data != null && data.Data.Any())
                    {
                        result.data = data.Data.Select(x => new ItemEvaluationItem()
                        {
                            reviewId      = x.ReviewId,
                            userId        = x.UserId,
                            nickName      = x.Nick == "匿名" ? x.Nick : Utils.DealUserName(x.Nick),
                            content       = x.Content,
                            createTime    = x.Created.ToString("yyyy-MM-dd"),
                            starLevel     = x.StarLevel,
                            reviewContent = x.ReviewContent
                        });
                    }
                }
                return(result);
            }
예제 #2
0
        /// <summary>
        /// 获取评价信息
        /// </summary>
        /// <param name="itemId"></param>
        /// <param name="level"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public ItemEvaluation getItemEvaluations(int itemId, int level, int pageIndex, int pageSize)
        {
            var data   = _bllProduct.GetItemEvaluations(itemId, level, pageIndex, pageSize);
            var result = new ItemEvaluation();

            if (data != null)
            {
                result = ProductDetailDto.Helper.getItemEvaluationItem(data);
            }
            return(result);
        }