RequestLogRouterSearch.php 961 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Module\System\Cache;
  3. use UCore\Model\RequestLog;
  4. /**
  5. *
  6. */
  7. class RequestLogRouterSearch extends \App\Module\LCache\QueueJob
  8. {
  9. public static function getTtl(): int
  10. {
  11. return 3600 * 24;
  12. }
  13. public static function getPreventDuplication(): int
  14. {
  15. return 3600;
  16. }
  17. static public function getNewData($parameter=[])
  18. {
  19. $data = RequestLog::query()
  20. ->groupBy('router')
  21. ->distinct()
  22. ->pluck('router', 'router')
  23. ->toArray();
  24. $res = [];
  25. $modules = [
  26. 'app', 'oap'
  27. ];
  28. foreach ($data as $k => $v) {
  29. if (in_array(substr($k, 0, 3), $modules)) {
  30. $res[$k] = $k;
  31. }
  32. }
  33. return $res;
  34. }
  35. /**
  36. * 获取参数索引
  37. * @return array
  38. */
  39. public static function getRequiredArgIndex(): array
  40. {
  41. return [];
  42. }
  43. }