HomeController.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 Tmp()
  47. {
  48. string result = "";
  49. // string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
  50. // DataTable dt = CustomerSqlConn.dtable("select UserId from HelpProfitAmountSummary where TradeMonth>MaxAmount and TradeMonth='202301'", conn);
  51. // foreach(DataRow dr in dt.Rows)
  52. // {
  53. // int UserId = int.Parse(dr["UserId"].ToString());
  54. // decimal HelpAmount = 0; //当天总交易额
  55. // DataTable dtsub = CustomerSqlConn.dtable("SELECT SUM(TradeAmount) TradeAmount FROM HelpProfitMerTradeSummay WHERE MerchantId IN(SELECT MerchantId FROM HelpProfitMerIds WHERE UserId=" + UserId + ") AND TradeDate='20230101'", conn);
  56. // if(dtsub.Rows.Count > 0)
  57. // {
  58. // HelpAmount = decimal.Parse(function.CheckNum(dtsub.Rows[0]["TradeAmount"].ToString()));
  59. // }
  60. // result += test(UserId, HelpAmount);
  61. // result += "\n\n";
  62. // }
  63. return result;
  64. }
  65. public string Test()
  66. {
  67. string result = "ok";
  68. StatService.Instance.Other();
  69. return result;
  70. }
  71. }
  72. }