M250613145855AddAddonsStoreExtra.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250613145855AddAddonsStoreExtra
  6. */
  7. class M250613145855AddAddonsStoreExtra extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_store_goods_extra` ADD COLUMN `service_fee_setting` longtext COMMENT '服务费设置';
  16. INSERT INTO `qimall_addons_store_menu` (`title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('服务费设置', '0', 8, '', 0, 'store/client/setting/service-fee', '', 2, 0, 999, NULL, '', 1, 0, 0);
  17. CREATE TABLE `qimall_addons_store_service_ratio_log`
  18. (
  19. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  20. `mall_id` int(11) unsigned NOT NULL DEFAULT '0',
  21. `store_id` int(11) unsigned NOT NULL DEFAULT '0',
  22. `before_store_service_ratio` decimal(12, 2) NOT NULL DEFAULT '0.00' COMMENT '变动前门店服务费比例',
  23. `after_store_service_ratio` decimal(12, 2) NOT NULL DEFAULT '0.00' COMMENT '变动后门店服务费比例',
  24. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,1:启用 0:禁用 -1:删除',
  25. `created_at` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
  26. `updated_at` int(10) unsigned DEFAULT '0' COMMENT '修改时间',
  27. PRIMARY KEY (`id`) USING BTREE
  28. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='O2O门店服务费比例记录(独立后台)';
  29. ;
  30. SQL;
  31. $this->execute($sql);
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function safeDown()
  37. {
  38. echo "M250613145855AddAddonsStoreExtra cannot be reverted.\n";
  39. return false;
  40. }
  41. }