| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Handles the creation of table `{{%payment_type_refund_statistics_details}}`.
- */
- class M241108110302CreatePaymentTypeRefundStatisticsDetailsTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_payment_type_refund_statistics_details` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `payment_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式',
- `statistics_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关联qimall_payment_type_refund_statistics表',
- `trade_type` varchar(100) NOT NULL DEFAULT '' COMMENT '聚合支付具体的支付方式',
- `total_refund_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '成功退款的退款金额',
- `total_pay_money` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '成功退款的订单的实付金额',
- `date` int(10) unsigned NOT NULL DEFAULT '0',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `statistics_id+payment_type+trade_type` (`statistics_id`,`payment_type`,`trade_type`) USING BTREE,
- KEY `statistics_id+date` (`statistics_id`,`date`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='统计每种支付方式的退款明细数据(拆表是为了兼容组合支付)';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- }
|