UserBehaviorLog.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. use yii\behaviors\TimestampBehavior;
  5. /**
  6. * This is the model class for table "{{%user_behavior_log}}".
  7. *
  8. * @property integer $id
  9. * @property string $behavior_name
  10. * @property integer $user_id
  11. * @property string $content
  12. * @property integer $created_at
  13. */
  14. class UserBehaviorLog extends \yii\db\ActiveRecord
  15. {
  16. /**
  17. * @inheritdoc
  18. */
  19. public static function tableName()
  20. {
  21. return '{{%user_behavior_log}}';
  22. }
  23. /**
  24. * @inheritdoc
  25. */
  26. public function rules()
  27. {
  28. return [
  29. [['behavior_id', 'user_id'], 'integer'],
  30. ['content', 'string']
  31. ];
  32. }
  33. /**
  34. * @inheritdoc
  35. */
  36. public function attributeLabels()
  37. {
  38. return [
  39. 'id' => Yii::t('common', 'ID'),
  40. 'behavior_id' => Yii::t('common', 'Behavior ID'),
  41. 'user_id' => Yii::t('common', 'User ID'),
  42. 'content' => Yii::t('common', '日志内容'),
  43. 'created_at' => Yii::t('common', 'Created At'),
  44. ];
  45. }
  46. public function behaviors()
  47. {
  48. return [
  49. [
  50. 'class' => TimestampBehavior::className(),
  51. 'updatedAtAttribute' => false
  52. ]
  53. ];
  54. }
  55. }