AdminLog.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace common\models;
  3. use common\modules\user\behaviors\UserBehavior;
  4. use common\modules\user\models\User;
  5. use yii\behaviors\TimestampBehavior;
  6. /**
  7. * This is the model class for table "{{%admin_log}}".
  8. *
  9. * @property integer $id
  10. * @property string $route
  11. * @property string $description
  12. * @property integer $created_at
  13. * @property integer $user_id
  14. * @property User $user
  15. */
  16. class AdminLog extends \yii\db\ActiveRecord
  17. {
  18. /**
  19. * @inheritdoc
  20. */
  21. public static function tableName()
  22. {
  23. return '{{%admin_log}}';
  24. }
  25. /**
  26. * @inheritdoc
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['description'], 'string'],
  32. [['user_id', 'ip'], 'integer'],
  33. [['route'], 'string', 'max' => 255]
  34. ];
  35. }
  36. /**
  37. * @inheritdoc
  38. */
  39. public function attributeLabels()
  40. {
  41. return [
  42. 'id' => 'ID',
  43. 'route' => '路由',
  44. 'description' => '详情',
  45. 'created_at' => '操作时间',
  46. 'user_id' => '操作人',
  47. 'ip' => '操作人ip'
  48. ];
  49. }
  50. public function behaviors()
  51. {
  52. return [
  53. [
  54. 'class' => TimestampBehavior::className(),
  55. 'updatedAtAttribute' => null
  56. ],
  57. UserBehavior::className()
  58. ];
  59. }
  60. }