Video.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. use yii\behaviors\TimestampBehavior;
  10. use yii\db\ActiveRecord;
  11. /**
  12. * This is the model class for table "{{%video}}".
  13. *
  14. * @property int $id
  15. * @property string|null $title 标题
  16. * @property string|null $url
  17. * @property string|null $sort 排序 升序
  18. * @property int|null $is_delete
  19. * @property int|null $created_at
  20. * @property int|null $store_id 商城id
  21. * @property string|null $pic_url
  22. * @property string|null $content 详情介绍
  23. * @property int|null $type 视频来源 0--源地址 1--腾讯视频
  24. * @property int|null $updated_at 更新时间
  25. */
  26. class Video extends ActiveRecord
  27. {
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public static function tableName()
  32. {
  33. return '{{%video}}';
  34. }
  35. const IS_DELETE_YES = 1;//已删除
  36. const IS_DELETE_NO = 0;//未删除
  37. public function behaviors()
  38. {
  39. return [
  40. [
  41. 'class' => TimestampBehavior::class,
  42. ]
  43. ];
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function rules()
  49. {
  50. return [
  51. [['is_delete', 'store_id', 'type', 'sort'], 'integer'],
  52. [['content'], 'string'],
  53. [['title'], 'string', 'max' => 255],
  54. [['url', 'pic_url'], 'string', 'max' => 2048],
  55. ['is_delete', 'default', 'value' => 0]
  56. ];
  57. }
  58. /**
  59. * {@inheritdoc}
  60. */
  61. public function attributeLabels()
  62. {
  63. return [
  64. 'id' => 'ID',
  65. 'title' => '标题',
  66. 'url' => 'Url',
  67. 'sort' => '排序 升序',
  68. 'is_delete' => 'Is Delete',
  69. 'store_id' => '商城id',
  70. 'pic_url' => 'Pic Url',
  71. 'content' => '详情介绍',
  72. 'type' => '视频来源 0--源地址 1--腾讯视频',
  73. ];
  74. }
  75. }