コード例 #1
0
        /// <summary>
        /// 获取礼包兑换码简要信息
        /// </summary>
        /// <param name="packId"></param>
        /// <returns></returns>
        public ActionResult GetRedemptionCodeSimpleInfo(long packId)
        {
            if (packId < 1)
            {
                return(Json(new { status = false, msg = "参数错误" }, JsonRequestBehavior.AllowGet));
            }
            var simpleInfos = new VipBaoYangPackageManager().GetRedemptionCodeSimpleAndRecord(packId);

            return(Json(new
            {
                data = simpleInfos.Select(x => new
                {
                    x.BatchCode,
                    CreateDateTime = x.CreateDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff"),
                    x.CreateUser,
                    Records = x.Records.Select(t => new
                    {
                        DownloadUser = t.OperateUser,
                        DownloadTime = t.CreateTime.ToString("yyyy-MM-dd HH:mm:ss.fff")
                    })
                }),
                status = true
            }));
        }