M241107142812AddTablePaymentTradeItem.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241107142812AddTablePaymentTradeItem
  6. */
  7. class M241107142812AddTablePaymentTradeItem extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_payment_trade_item` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL COMMENT '商城ID',
  18. `trade_id` int(10) unsigned NOT NULL COMMENT '支付订单ID',
  19. `user_id` int(10) unsigned NOT NULL COMMENT '用户ID',
  20. `pay_type` tinyint(4) unsigned NOT NULL COMMENT '支付类型',
  21. `pay_fee` decimal(10,2) unsigned NOT NULL COMMENT '支付金额',
  22. `is_pay` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否支付',
  23. `pay_mode` tinyint(1) unsigned NOT NULL COMMENT '支付模式',
  24. `is_close` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否关闭订单退款',
  25. `is_refund` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否售后订单退款',
  26. `updated_at` int(10) DEFAULT NULL,
  27. `created_at` int(10) DEFAULT NULL,
  28. `trade_type` varchar(100) NOT NULL DEFAULT '' COMMENT '聚合支付具体的支付方式(如汇聚-微信,汇聚-支付宝)',
  29. PRIMARY KEY (`id`)
  30. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='支付流水子项';
  31. SQL;
  32. $this->execute($sql);
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function safeDown()
  38. {
  39. return false;
  40. }
  41. }