SystemCrontab.php 833 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * 是否自定义定时任务搜索器
  20. * @param $query
  21. * @param $value
  22. * @param $data
  23. * @author wuhaotian
  24. * @email 442384644@qq.com
  25. * @date 2024/6/6
  26. */
  27. public function searchCustomAttr($query, $value, $data)
  28. {
  29. if ($value !== '') {
  30. if ($value == 0) {
  31. $query->where('mark', '<>', 'customTimer');
  32. } else {
  33. $query->where('mark', 'customTimer');
  34. }
  35. }
  36. }
  37. }