Queue.php 673 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace backend\models;
  3. use yii\behaviors\TimestampBehavior;
  4. use yii\db\Expression;
  5. /**
  6. * 队列
  7. * Class Queue
  8. * @package backend\models
  9. */
  10. class Queue extends \yii\db\ActiveRecord
  11. {
  12. const STATUS_YES = 1;
  13. const STATUS_NO = 0;
  14. /**
  15. * @inheritdoc
  16. */
  17. public static function tableName()
  18. {
  19. return '{{%queue}}';
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function behaviors()
  25. {
  26. return [
  27. [
  28. 'class' => TimestampBehavior::className(),
  29. 'createdAtAttribute' => 'created_at',
  30. 'updatedAtAttribute' => 'updated_at',
  31. //'value' => new Expression('NOW()'),
  32. 'value' => function() { return time();},
  33. ],
  34. ];
  35. }
  36. }