Recharge.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. use Yii;
  11. /**
  12. * This is the model class for table "{{%recharge}}".
  13. *
  14. * @property int $id
  15. * @property int|null $store_id
  16. * @property float $pay_price 支付金额
  17. * @property float $send_price 赠送金额
  18. * @property string $name 充值名称
  19. * @property int|null $is_delete
  20. * @property int|null $created_at
  21. * @property int|null $updated_at
  22. * @property int|null $sort 权重
  23. * @property int|null $send_integral
  24. */
  25. class Recharge extends \yii\db\ActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return '{{%recharge}}';
  33. }
  34. const IS_DELETE_YES = 1;//已删除
  35. const IS_DELETE_NO = 0;//未删除
  36. public function behaviors()
  37. {
  38. return [
  39. [
  40. 'class' => TimestampBehavior::class,
  41. 'attributes' => [
  42. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  43. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  44. ]
  45. ]
  46. ];
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function rules()
  52. {
  53. return [
  54. [['store_id', 'is_delete', 'created_at', 'updated_at', 'sort', 'send_integral','level_up'], 'integer'],
  55. [['pay_price', 'send_price','level_one_bonus','level_two_bonus',], 'number'],
  56. [['name'], 'required'],
  57. [['name','assign_member'], 'string', 'max' => 255],
  58. [['referral_commission'], 'string'],
  59. ];
  60. }
  61. /**
  62. * {@inheritdoc}
  63. */
  64. public function attributeLabels()
  65. {
  66. return [
  67. 'id' => 'ID',
  68. 'store_id' => 'Store ID',
  69. 'pay_price' => '支付金额',
  70. 'send_price' => '赠送金额',
  71. 'name' => '充值名称',
  72. 'is_delete' => 'Is Delete',
  73. 'created_at' => 'Add Time',
  74. 'updated_at' => 'Update Time',
  75. 'sort' => '权重',
  76. 'send_integral' => '赠送积分',
  77. ];
  78. }
  79. }