示例#1
0
        public IActionResult GetMessage(int page_index, int page_size, int category)
        {
            int rowcount;
            var listres = message_dal.GetList(page_index, page_size, category, out rowcount);
            int allpage = rowcount / page_size + 1;
            var list    = listres.Select(x => new {
                x.id,
                x.user_img,
                x.wechatuser,
                x.phone,
                x.content,
                createdate = x.createdate.ToString("yyyy-MM-dd HH:mm"),
                x.views,
                x.givelike,
                img = x.imgs.Select(p => p.path),
            });

            return(new JsonResult(new { list, allpage }));
        }