ScheduleDict.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\schedule;
  12. class ScheduleDict
  13. {
  14. public const CRON = 'cron';//定时任务
  15. public const CROND = 'crond';//周期任务
  16. public const ON = 1;
  17. public const OFF = 2;
  18. public const MIN = 'min';
  19. public const HOUR = 'hour';
  20. public const DAY = 'day';//每隔几分钟
  21. public const WEEK = 'week';//每隔几小时
  22. public const MONTH = 'month';//每隔几天
  23. /**
  24. * 任务模式
  25. * @return array
  26. */
  27. public static function getType()
  28. {
  29. return [
  30. self::CRON => get_lang('dict_schedule.type_cron'),//定时任务
  31. self::CROND => get_lang('dict_schedule.type_crond'),//周期任务
  32. ];
  33. }//每周
  34. /**
  35. * 任务启用状态
  36. * @return array
  37. */
  38. public static function getStatus()
  39. {
  40. return [
  41. self::ON => get_lang('dict_schedule.on'),//启用
  42. self::OFF => get_lang('dict_schedule.off'),//关闭
  43. ];
  44. }//每月
  45. public static function getDateType()
  46. {
  47. return [
  48. self::MIN => get_lang('dict_schedule.min'),
  49. self::HOUR => get_lang('dict_schedule.hour'),
  50. self::DAY => get_lang('dict_schedule.day'),
  51. self::WEEK => get_lang('dict_schedule.week'),
  52. self::MONTH => get_lang('dict_schedule.month'),
  53. ];
  54. }
  55. }