PageInfoController.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Data;
  5. using Microsoft.AspNetCore.Mvc;
  6. using Microsoft.AspNetCore.Http;
  7. using Microsoft.Extensions.Logging;
  8. using Microsoft.Extensions.Options;
  9. using Microsoft.AspNetCore.Authorization;
  10. using MySystem.MainModels;
  11. using LitJson;
  12. using Library;
  13. using System.Security.Cryptography;
  14. using System.Text;
  15. namespace MySystem.Areas.Api.Controllers.v1
  16. {
  17. [Area("Api")]
  18. [Route("/v1/QrCodePlateMain/[controller]/[action]")]
  19. public class PageInfoController : ConsumersController
  20. {
  21. public PageInfoController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
  22. {
  23. }
  24. #region 我的-分红记录-列表
  25. [Authorize]
  26. public JsonResult AgreeMentInfo(string value)
  27. {
  28. value = DesDecrypt(value);
  29. JsonData data = JsonMapper.ToObject(value);
  30. Dictionary<string, object> Other = new Dictionary<string, object>();
  31. List<Dictionary<string, object>> dataList = AgreeMentInfoDo(value, out Other);
  32. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other });
  33. }
  34. private List<Dictionary<string, object>> AgreeMentInfoDo(string value, out Dictionary<string, object> Other)
  35. {
  36. JsonData data = JsonMapper.ToObject(value);
  37. int Id = int.Parse(function.CheckInt(data["Id"].ToString())); //Id
  38. List<RelationData> relationData = new List<RelationData>();
  39. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  40. DataTable dt = CustomerSqlConn.dtable("SELECT Title,Contents FROM PageInfo WHERE Id=" + Id + "", AppConfig.Base.BsSqlConnStr);
  41. foreach (DataRow dr in dt.Rows)
  42. {
  43. Dictionary<string, object> curData = new Dictionary<string, object>();
  44. curData.Add("Title", dr["SeoTitle"].ToString()); //标题
  45. curData.Add("Contents", dr["Contents"].ToString()); //创建时间
  46. dataList.Add(curData);
  47. }
  48. Other = new Dictionary<string, object>();
  49. Other.Add("count", dt.Rows.Count);
  50. return dataList;
  51. }
  52. #endregion
  53. }
  54. }