Level.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 "{{%level}}".
  11. *
  12. * @property integer $id
  13. * @property integer $store_id
  14. * @property integer $level
  15. * @property string $name
  16. * @property string $status
  17. * @property string $money
  18. * @property string $discount
  19. * @property integer $is_delete
  20. * @property integer $created_at
  21. * @property string $image
  22. * @property string $price
  23. * @property string $detail
  24. * @property string $buy_prompt
  25. * @property string $synopsis
  26. * @property float $firstProfit
  27. * @property float $secondProfit
  28. * @property float $thirdProfit
  29. * @property integer $is_student
  30. * @property integer $expires_type
  31. * @property integer $expires_in
  32. */
  33. class Level extends \yii\db\ActiveRecord
  34. {
  35. /**
  36. * 会员禁用状态:0: 禁用, 1:启用
  37. */
  38. CONST STATUS_FALSE = 0;
  39. CONST STATUS_TRUE = 1;
  40. CONST STUDENT_FALSE = 0;
  41. CONST STUDENT_TRUE = 1;
  42. public $valid_level_status = [
  43. self::STATUS_FALSE,
  44. self::STATUS_TRUE
  45. ];
  46. /**
  47. * 是否删除
  48. */
  49. CONST IS_DELETE = 1;
  50. CONST NOT_DELETE = 0;
  51. public $valid_delete_status = [
  52. self::IS_DELETE,
  53. self::NOT_DELETE
  54. ];
  55. const EXPIRES_TYPE_DAY = 0;
  56. const EXPIRES_TYPE_YEAR = 1;
  57. /**
  58. * @inheritdoc
  59. */
  60. public static function tableName()
  61. {
  62. return '{{%level}}';
  63. }
  64. /**
  65. * @inheritdoc
  66. */
  67. public function rules()
  68. {
  69. return [
  70. [['store_id', 'level', 'status', 'is_delete', 'created_at', 'is_student', 'expires_type'], 'integer'],
  71. [['money', 'discount', 'price', 'firstProfit', 'secondProfit', 'thirdProfit', 'expires_in'], 'number'],
  72. [['image', 'synopsis'], 'string'],
  73. [['name', 'detail', 'buy_prompt'], 'string', 'max' => 255],
  74. ];
  75. }
  76. /**
  77. * @inheritdoc
  78. */
  79. public function attributeLabels()
  80. {
  81. return [
  82. 'id' => 'ID',
  83. 'store_id' => 'Store ID',
  84. 'level' => 'Level',
  85. 'name' => '等级名称',
  86. 'money' => '会员完成订单金额满足则升级',
  87. 'discount' => '折扣',
  88. 'status' => '状态 0--禁用 1--启用',
  89. 'is_delete' => 'Is Delete',
  90. 'created_at' => '添加时间',
  91. 'image' => '升级 图片',
  92. 'price' => '升级 所需价格',
  93. 'detail' => '会员介绍',
  94. 'buy_prompt' => '会员购买提示',
  95. 'synopsis' => '内容',
  96. 'firstProfit' => '一级分销佣金',
  97. 'secondProfit' => '二级分销佣金',
  98. 'thirdProfit' => '三级分销佣金',
  99. 'is_student' => '是否学生会员:0=否;1=是;',
  100. 'expires_type' => '到期类型0天 1年',
  101. 'expires_in' => '到期时间'
  102. ];
  103. }
  104. }