HomeController.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Data;
  6. using System.Threading.Tasks;
  7. using Microsoft.AspNetCore.Mvc;
  8. using Microsoft.Extensions.Logging;
  9. using MySystem.PxcModels;
  10. using System.Threading;
  11. using Library;
  12. using LitJson;
  13. namespace MySystem.Controllers
  14. {
  15. public class HomeController : Controller
  16. {
  17. private readonly ILogger<HomeController> _logger;
  18. public HomeController(ILogger<HomeController> logger)
  19. {
  20. _logger = logger;
  21. }
  22. public IActionResult Index()
  23. {
  24. return View();
  25. }
  26. public IActionResult Error()
  27. {
  28. string isapi = Request.Headers["Api"].ToString();
  29. if (isapi != "1")
  30. {
  31. if (Response.StatusCode == 500)
  32. {
  33. return Redirect("/public/errpage/pc/500.html");
  34. }
  35. else if (Response.StatusCode == 502)
  36. {
  37. return Redirect("/public/errpage/pc/502.html");
  38. }
  39. else if (Response.StatusCode == 404)
  40. {
  41. return Redirect("/public/errpage/pc/404.html");
  42. }
  43. }
  44. return View();
  45. }
  46. public string test(int id = 0)
  47. {
  48. string txt = "ok";
  49. // txt = WeChatFunction.Instance.QueryProfitShare("1646405429","4200001807202306098649105270","2023060910241258564572510");
  50. // ProfitHelper.Instance.ReturnStat(Id, 2);
  51. WebCMSEntities db = new WebCMSEntities();
  52. List<int> oids = new List<int>();
  53. if(id > 0)
  54. {
  55. oids.Add(id);
  56. }
  57. else
  58. {
  59. oids.Add(15);
  60. oids.Add(16);
  61. oids.Add(17);
  62. oids.Add(18);
  63. oids.Add(19);
  64. oids.Add(20);
  65. }
  66. foreach(int oid in oids)
  67. {
  68. ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == oid);
  69. if(order != null)
  70. {
  71. RedisDbconn.Instance.AddList("ConsumerOrders:Divi:2:List", order.Id.ToString());
  72. // RedisDbconn.Instance.AddList("ConsumerOrders:Divi:2:" + order.MerchantId, order);
  73. }
  74. }
  75. db.Dispose();
  76. return txt;
  77. }
  78. }
  79. }