RedRule.php 973 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. class RedRule extends \yii\db\ActiveRecord
  5. {
  6. /**
  7. * @inheritdoc
  8. */
  9. public static function tableName()
  10. {
  11. return '{{%red_rule}}';
  12. }
  13. /**
  14. * @inheritdoc
  15. */
  16. public function rules()
  17. {
  18. return [
  19. [['red_id', 'usecount', 'created_at', 'start_price', 'end_price','joincount'], 'required'],
  20. [['red_id', 'usecount', 'created_at','joincount'], 'integer'],
  21. [['start_price','end_price'], 'number'],
  22. ];
  23. }
  24. /**
  25. * @inheritdoc
  26. */
  27. public function attributeLabels()
  28. {
  29. return [
  30. 'id' => 'ID',
  31. 'red_id' => '红包活动id',
  32. 'usecount' => '红包被打开次数',
  33. 'created_at' => '创建时间',
  34. 'start_price' => '红包最小金额',
  35. 'end_price'=>'红包最大金额',
  36. 'joincount' => '可参与活动次数',
  37. ];
  38. }
  39. }