M241204062240AddIsNotAllowBalancePayAndIsGivingUseAndDayLimitColumnToCouponTable.php 912 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace addons\Coupon\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles adding columns to table `{{%coupon}}`.
  6. */
  7. class M241204062240AddIsNotAllowBalancePayAndIsGivingUseAndDayLimitColumnToCouponTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_coupon`
  16. ADD COLUMN `is_not_allow_balance_pay` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '不允许叠加余额支付(开启后,使用该优惠券时不可使用余额支付)',
  17. ADD COLUMN `is_giving_use` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '只有通过转增领取的才可以使用',
  18. ADD COLUMN `day_limit` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户每天使用该优惠券的次数';
  19. SQL;
  20. $this->execute($sql);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. return false;
  28. }
  29. }