TaskResetLog.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace App\Module\Task\Models;
  3. use UCore\ModelCore;
  4. /**
  5. * 任务重置日志模型
  6. *
  7. * field start
  8. * @property int $id 主键
  9. * @property string $reset_type 重置类型(daily, weekly, monthly)
  10. * @property string $reset_time 重置时间
  11. * @property object|array $affected_tasks 受影响的任务ID列表(JSON格式)
  12. * @property int $affected_count 受影响的任务数量
  13. * @property \Carbon\Carbon $created_at 创建时间
  14. * field end
  15. */
  16. class TaskResetLog extends ModelCore
  17. {
  18. /**
  19. * 与模型关联的表名
  20. *
  21. * @var string
  22. */
  23. protected $table = 'task_reset_logs';
  24. /**
  25. * 主键
  26. *
  27. * @var string
  28. */
  29. protected $primaryKey = 'id';
  30. /**
  31. * 应该被转换为原生类型的属性
  32. *
  33. * @var array
  34. */
  35. protected $casts = [
  36. 'affected_tasks' => 'array',
  37. ];
  38. /**
  39. * 应该被转换为日期的属性
  40. *
  41. * @var array
  42. */
  43. protected $dates = [
  44. 'reset_time',
  45. 'created_at',
  46. ];
  47. /**
  48. * 指示模型是否应该被打上时间戳
  49. *
  50. * @var bool
  51. */
  52. public $timestamps = false;
  53. // attrlist start
  54. protected $fillable = [
  55. 'id',
  56. 'reset_type',
  57. 'reset_time',
  58. 'affected_tasks',
  59. 'affected_count',
  60. ];
  61. // attrlist end
  62. }