Plugins.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. /**
  10. * This is the model class for table "{{%plugins}}".
  11. *
  12. * @property integer $id
  13. * @property integer $store_id
  14. * @property string $name
  15. * @property string $key
  16. * @property string $version
  17. * @property string $main_version
  18. * @property integer $status
  19. * @property integer $is_can_update
  20. * @property integer $is_can_install
  21. * @property integer $expire_time
  22. * @property integer $updated_at
  23. * @property integer $created_at
  24. */
  25. class Plugins extends \yii\db\ActiveRecord
  26. {
  27. /**
  28. * TODO: status 状态
  29. */
  30. const STATUS_OPEN = 1;
  31. const STATUS_CLOSE = 0;
  32. /**
  33. * 远程或者本地
  34. */
  35. const TYPE_FROM_CLOUD = 1;
  36. const TYPE_FROM_LOCAL = 2;
  37. /**
  38. * 安装或者未安装
  39. */
  40. const TYPE_INSTALL_TRUE = 1;
  41. const TYPE_INSTALL_FALSE = 0;
  42. /**
  43. * @inheritdoc
  44. */
  45. public static function tableName()
  46. {
  47. return '{{%plugins}}';
  48. }
  49. /**
  50. * @inheritdoc
  51. */
  52. public function rules()
  53. {
  54. return [
  55. [['store_id', 'status', 'created_at', 'updated_at', 'expire_time','is_can_update', 'is_can_install'],
  56. 'integer'],
  57. [['name', 'key', 'version', 'main_version'], 'string'],
  58. [['name', 'key'], 'string', 'max' => 255],
  59. ];
  60. }
  61. /**
  62. * @inheritdoc
  63. */
  64. public function attributeLabels()
  65. {
  66. return [
  67. 'id' => 'ID',
  68. 'store_id' => 'Store ID',
  69. 'name' => '名称',
  70. 'key' => '唯一标识',
  71. 'version' => '插件版本',
  72. 'main_version' => '代码主版本',
  73. 'status' => '状态',
  74. 'is_can_update' => '是否可以更新',
  75. 'is_can_install' => '是否可以下载',
  76. 'created_at' => '添加时间',
  77. 'updated_at' => '更新时间',
  78. 'expire_time' => '过期时间',
  79. ];
  80. }
  81. }