RequestLogRouter.php 984 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. $res=[];
  28. foreach ($data as $k => $v) {
  29. if (in_array(substr($k, 0, 3), $parameter)) {
  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. }