| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace addons\Coupon\console\migrations;
- use yii\db\Migration;
- /**
- * Handles adding columns to table `{{%coupon}}`.
- */
- class M241204062240AddIsNotAllowBalancePayAndIsGivingUseAndDayLimitColumnToCouponTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- ALTER TABLE `qimall_addons_coupon`
- ADD COLUMN `is_not_allow_balance_pay` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '不允许叠加余额支付(开启后,使用该优惠券时不可使用余额支付)',
- ADD COLUMN `is_giving_use` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '只有通过转增领取的才可以使用',
- ADD COLUMN `day_limit` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户每天使用该优惠券的次数';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- }
|