CrontabLog.php 736 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. class CrontabLog extends Model
  5. {
  6. // 开启自动写入时间戳字段
  7. protected $autoWriteTimestamp = 'int';
  8. // 定义时间戳字段名
  9. protected $createTime = false;
  10. protected $updateTime = false;
  11. // 定义字段类型
  12. protected $type = [
  13. ];
  14. // 追加属性
  15. protected $append = [
  16. ];
  17. public function getStatusList()
  18. {
  19. return ['success' => __('Success'), 'failure' => __('Failure'), 'inprogress' => __('Inprogress')];
  20. }
  21. public function getStatusTextAttr($value, $data)
  22. {
  23. $value = $value ?: ($data['status'] ?? '');
  24. $list = $this->getStatusList();
  25. return $list[$value] ?? '';
  26. }
  27. }