SystemCrontab.php 936 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\model\system\crontab;
  3. use crmeb\basic\BaseModel;
  4. use crmeb\traits\ModelTrait;
  5. class SystemCrontab extends BaseModel
  6. {
  7. use ModelTrait;
  8. /**
  9. * 数据表主键
  10. * @var string
  11. */
  12. protected $pk = 'id';
  13. /**
  14. * 模型名称
  15. * @var string
  16. */
  17. protected $name = 'system_timer';
  18. /**
  19. * 不自动更新update_time
  20. * @var bool
  21. */
  22. protected $updateTime = false;
  23. /**
  24. * 是否自定义定时任务搜索器
  25. * @param $query
  26. * @param $value
  27. * @param $data
  28. * @author wuhaotian
  29. * @email 442384644@qq.com
  30. * @date 2024/6/6
  31. */
  32. public function searchCustomAttr($query, $value, $data)
  33. {
  34. if ($value !== '') {
  35. if ($value == 0) {
  36. $query->where('mark', '<>', 'customTimer');
  37. } else {
  38. $query->where('mark', 'customTimer');
  39. }
  40. }
  41. }
  42. }