M240323090829StoreHuifuPayShareAmount.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240323090829StoreHuifuPayShareAmount
  6. */
  7. class M240323090829StoreHuifuPayShareAmount extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("ALTER TABLE `qimall_addons_store_settings`
  15. ADD COLUMN `huifu_mch_no` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '汇付商户号';");
  16. $this->execute("ALTER TABLE `qimall_addons_store`
  17. ADD COLUMN `share_amount` DECIMAL(12,2) NOT NULL DEFAULT '0.00' COMMENT '已分账金额';");
  18. $this->execute("INSERT INTO `qimall_addons_store_addons` (`title`, `name`, `cover`, `brief_introduction`, `status`, `created_at`, `updated_at`) VALUES ('汇付记录', 'HuifuPay', '', '汇付支付分账记录', 1, 1702975895, 1702975895);");
  19. $this->execute("INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES (123, '支付记录', '0', 122, 'store/huifu-pay/index/index', '', 2, 0, 999, NULL, '', 1, 0, 0, 'HuifuPay', 1);");
  20. $this->execute("INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES (122, '支付记录', '0', 0, 'store/huifu-pay/index/index', '', 2, 0, 999, NULL, '', 1, 0, 0, 'HuifuPay', 1);");
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M240323090829StoreHuifuPayShareAmount cannot be reverted.\n";
  28. return false;
  29. }
  30. /*
  31. // Use up()/down() to run migration code without a transaction.
  32. public function up()
  33. {
  34. }
  35. public function down()
  36. {
  37. echo "M240323090829StoreHuifuPayShareAmount cannot be reverted.\n";
  38. return false;
  39. }
  40. */
  41. }