RequestLogRouter.php 967 B

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