| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240103081935MixedPay
- */
- class M240103081935MixedPay extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_payment_trade_group_order` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `trade_id` int(11) NOT NULL DEFAULT '0' COMMENT '流水表ID',
- `order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '订单号',
- `order_type` varchar(32) NOT NULL DEFAULT '' COMMENT '订单类型',
- `pay_fee` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单支付金额',
- `total_fee` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单总金额,pay_fee+rand_fee',
- `rand_fee` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单随机减金额',
- `is_pay` int(1) NOT NULL DEFAULT '0' COMMENT '支付状态:0=未支付,1=已支付',
- `pay_type` int(1) NOT NULL DEFAULT '0' COMMENT '支付方式:1=微信支付,2=货到付款,3=余额支付,4=支付宝支付,5=银联支付,6=汇聚聚合支付,7=汇聚快捷支付',
- `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- `notify_class` varchar(512) NOT NULL DEFAULT '',
- `refund_fee` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `union_id` (`trade_id`) USING BTREE,
- KEY `order_no` (`order_no`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='订单组合支付记录表';";
- $this->execute($sql);
- $sql = "ALTER TABLE `qimall_payment_trade`
- ADD COLUMN `is_pay_group` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否组合支付订单 0 否 1 是',
- ADD COLUMN `parent_trade_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联上级支付流水id(组合支付子订单不为空)';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240103081935MixedPay cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240103081935MixedPay cannot be reverted.\n";
- return false;
- }
- */
- }
|