Task.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "task".
  6. *
  7. * @property integer $id
  8. * @property string $userid
  9. * @property integer $status
  10. * @property integer $at
  11. * @property string $title
  12. * @property string $commitid
  13. */
  14. class Task extends \yii\db\ActiveRecord
  15. {
  16. const ACTION_ONLINE = 0;
  17. const ACTION_ROLLBACK = 1;
  18. /**
  19. * 任务新提交
  20. */
  21. const STATUS_SUBMIT = 0;
  22. /**
  23. * 任务通过
  24. */
  25. const STATUS_PASS = 1;
  26. /**
  27. * 任务拒绝
  28. */
  29. const STATUS_REFUSE = 2;
  30. /**
  31. * 任务上线完成
  32. */
  33. const STATUS_DONE = 3;
  34. /**
  35. * 任务上线失败
  36. */
  37. const STATUS_FAILED = 4;
  38. /**
  39. * @inheritdoc
  40. */
  41. public static function tableName()
  42. {
  43. return 'task';
  44. }
  45. /**
  46. * @inheritdoc
  47. */
  48. public function rules()
  49. {
  50. return [
  51. [['user_id', 'status', 'created_at', 'title', 'commit_id', 'project_id'], 'required'],
  52. [['user_id', 'status', 'created_at', 'project_id', 'action'], 'integer'],
  53. [['title', 'commit_id', 'link_id', 'ex_link_id'], 'string', 'max' => 100],
  54. ];
  55. }
  56. /**
  57. * @inheritdoc
  58. */
  59. public function attributeLabels()
  60. {
  61. return [
  62. 'id' => 'ID',
  63. 'user_id' => 'user_id',
  64. 'status' => 'Status',
  65. 'created_at' => 'created_at',
  66. 'title' => 'Title',
  67. 'commit_id' => 'commit_id',
  68. 'ex_link_id' => 'ex_link_id',
  69. ];
  70. }
  71. }