Пример #1
0
        public HttpResponseMessage GetCrowdInfo(int status = -1)
        {
            //查询项目表所有的数据
            var sech = new CrowdSearchCondition
            {
                OrderBy = EnumCrowdSearchOrderBy.OrderById,
                Statuss = status
            };
            var list = _crowdService.GetCrowdsByCondition(sech).Select(p => new
            {
                //项目表
                p.Ttitle,
                p.Id,
                p.Status,
                p.Intro,
                p.Starttime,
                p.Endtime,
                p.Uptime,
                p.Upuser,
                p.Adduser,
                p.Addtime,
                p.crowdUrl
            }).ToList().Select(a => new
            {
                //返回数据
                Id        = a.Id,
                Ttitle    = a.Ttitle,
                Intro     = a.Intro,
                Endtime   = a.Endtime,
                Starttime = a.Starttime,
                Status    = a.Status,
                ImgList   = _partImageService.GetPartImageByCrowdId(a.Id),//查询众筹对应的图片
                // Dislist = _discountService.GetDiscountByCrowdId(a.Id),//查询众筹人数
                ////已参与众筹人数
                //crowdNum = _participationService.GetParticipationCountByCrowdId(a.Id),
                ////众筹最低优惠对应的人数
                //crowdMaxNum = _discountService.GetDiscountMaxCountByCrowdId(a.Id),
                crowdUrl = a.crowdUrl,
                //Addtime=a.Addtime.ToString("yyyy-MM-dd") ,
                Addtime = a.Addtime.ToString("yyyy-MM-dd"),
                i       = 0
            });

            //.Where(p => p.crowdMaxNum != 0);
            return(PageHelper.toJson(new { list }));
        }
Пример #2
0
        public ActionResult crowd()
        {
            //查询项目表所有的数据
            var sech = new CrowdSearchCondition
            {
                OrderBy = EnumCrowdSearchOrderBy.OrderById,
                //Statuss = new[] { status }
            };
            var list = _crowdService.GetCrowdsByCondition(sech).Select(p => new
            {
                //项目表
                p.Ttitle,
                p.Id,
                p.Status,
                p.Intro,
                p.Starttime,
                p.Endtime,
                p.Uptime,
                p.Upuser,
                p.Adduser,
                p.Addtime
            }).ToList().Select(a => new CrowdModel
            {
                //返回数据
                Id        = a.Id,
                Ttitle    = a.Ttitle,
                Intro     = a.Intro,
                Endtime   = a.Endtime,
                Starttime = a.Starttime,
                Status    = a.Status,
                ImgList   = _partImageService.GetPartImageByCrowdId(a.Id),
                Dislist   = _discountService.GetDiscountByCrowdId(a.Id),
                //已参与众筹人数
                crowdNum = _participationService.GetParticipationCountByCrowdId(a.Id),
                //众筹最低优惠对应的人数
                crowdMaxNum = _discountService.GetDiscountMaxCountByCrowdId(a.Id),
            }).Where(p => p.crowdMaxNum != 0);

            return(View(list));
        }