LiveRoomPurview.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. /**
  11. * This is the model class for table "{{%live_room_purview}}".
  12. *
  13. * @property int $id
  14. * @property int $store_id
  15. * @property int $room_id 直播间ID
  16. * @property string $user_id 用户ID
  17. * @property string $level_id 会员等级ID
  18. * @property string $type 可见范围:0=所有人;1=指定用户;2=指定会员;
  19. * @property int $created_at 添加时间
  20. * @property int $updated_at 更新时间
  21. * @property int $is_delete 是否删除:0=否;1=是;
  22. */
  23. class LiveRoomPurview extends \yii\db\ActiveRecord
  24. {
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public static function tableName()
  29. {
  30. return '{{%live_room_purview}}';
  31. }
  32. public function behaviors()
  33. {
  34. return [
  35. [
  36. 'class' => TimestampBehavior::class,
  37. 'attributes' => [
  38. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  39. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  40. ]
  41. ]
  42. ];
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function rules()
  48. {
  49. return [
  50. [['store_id'], 'required'],
  51. [['store_id','updated_at', 'created_at', 'is_delete', 'type', 'room_id'], 'integer'],
  52. [['user_id', 'level_id'], 'string', 'max' => 255],
  53. ];
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. public function attributeLabels()
  59. {
  60. return [
  61. 'id' => 'ID',
  62. 'store_id' => 'Store ID',
  63. 'room_id' => '直播间ID',
  64. 'user_id' => '用户ID',
  65. 'level_id' => '会员等级ID',
  66. 'type' => '可见范围:0=所有人;1=指定用户;2=指定会员',
  67. 'is_delete' => '是否删除:0=否;1=是;',
  68. 'created_at' => '添加时间',
  69. 'updated_at' => 'Update Time',
  70. ];
  71. }
  72. }