db->createCommand($sql)->execute(); if(!empty($res)) return ''; $this->createTable($table, [ 'id' => $this->primaryKey(), 'mall_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('商城ID'), 'store_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('门店'), 'coupon_give_item_setting_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('设置id'), 'coupon_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('优惠券id'), 'from_type' => $this->tinyInteger(1)->notNull()->defaultValue(1)->comment('1:平台优惠券;2:门店优惠券'), 'num' => $this->integer(11)->notNull()->defaultValue(0)->comment('赠送数量'), 'status' => $this->tinyInteger(1)->notNull()->defaultValue(1)->comment('状态[-1:删除;0:禁用;1启用]'), 'created_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('添加时间'), 'updated_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('修改时间'), ]); $this->addCommentOnTable($table,'优惠券项目赠送设置详情'); } /** * {@inheritdoc} */ public function safeDown() { echo "M220906031204QimallAddonsStoreCouponGiveItemSettingDetail cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M220906031204QimallAddonsStoreCouponGiveItemSettingDetail cannot be reverted.\n"; return false; } */ }