ShareLevelLog.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 "{{%share_level_log}}".
  13. *
  14. * @property integer $id
  15. * @property integer $level
  16. * @property integer $type
  17. * @property string $value
  18. * @property integer $store_id
  19. * @property integer $is_delete
  20. * @property integer $created_at
  21. * @property integer $updated_at
  22. * @property integer $user_id
  23. * @property integer $old_level
  24. */
  25. class ShareLevelLog extends \yii\db\ActiveRecord
  26. {
  27. /**
  28. * @inheritdoc
  29. */
  30. public static function tableName()
  31. {
  32. return '{{%share_level_log}}';
  33. }
  34. /**
  35. * 删除状态
  36. */
  37. CONST SHARE_IS_DELETE = 1; //已删除
  38. CONST SHARE_NOT_DELETE = 0; //未删除
  39. /**
  40. * 升级条件
  41. */
  42. CONST TYPE_MEMBER = 0; //下级人数
  43. CONST TYPE_COMMISSION = 1; //累计佣金
  44. CONST TYPE_SEND_COMMISSION = 2; //已提现佣金
  45. CONST TYPE_AMOUNT = 3; //累计消费金额
  46. CONST TYPE_ADMIN = 4; //累计消费金额
  47. public static $valid_type_arr = [
  48. self::TYPE_MEMBER,
  49. self::TYPE_COMMISSION,
  50. self::TYPE_SEND_COMMISSION,
  51. self::TYPE_AMOUNT,
  52. self::TYPE_ADMIN
  53. ];
  54. /**
  55. * @inheritdoc
  56. */
  57. public function rules()
  58. {
  59. return [
  60. [['id', 'level', 'type', 'store_id', 'is_delete', 'user_id', 'old_level'], 'integer'],
  61. [['value'], 'number'],
  62. [['created_at', 'updated_at'], 'safe']
  63. ];
  64. }
  65. public function behaviors()
  66. {
  67. return [
  68. [
  69. 'class' => TimestampBehavior::class,
  70. 'value' => time()
  71. ]
  72. ];
  73. }
  74. /**
  75. * @inheritdoc
  76. */
  77. public function attributeLabels()
  78. {
  79. return [
  80. "id" => "ID",
  81. "level" => "等级",
  82. "type" => "升级条件类型",
  83. "value" => "升级条件值",
  84. "store_id" => "Store Id",
  85. "is_delete" => "is Delete",
  86. "created_at" => "创建时间",
  87. "updated_at" => "修改时间",
  88. "user_id" => "用户id",
  89. "old_level" => "旧等级",
  90. ];
  91. }
  92. }