TaskResetLog.php 1.5 KB

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