| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250324110655InsertAddonsStoreMenu
- */
- class M250324110655InsertAddonsStoreMenu extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $time = time();
- $sql = <<<SQL
- 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', 0, 'StoreSteward', 1, 'store/store-steward/default/index', '', 2, 0, 999, NULL, '', 1, {$time}, {$time});
- SQL;
- $this->execute($sql);
- $id = $this->db->getLastInsertID($sql);
- $sql2 = <<<SQL
- 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', {$id}, 'StoreSteward', 1, 'store/store-steward/default/diy-index', '', 2, 0, 999, NULL, '', 1, {$time}, {$time});
- SQL;
- $this->execute($sql2);
- $sql3 = <<<SQL
- 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', {$id}, 'StoreSteward', 1, 'store/store-steward/default/index', '', 2, 0, 999, NULL, '', 1, {$time}, {$time});
- SQL;
- $this->execute($sql3);
- $sql4 = <<<SQL
- 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', {$id}, 'StoreSteward', 1, 'store/store-steward/setting/index', '', 2, 0, 999, NULL, '', 1, {$time}, {$time});
- SQL;
- $this->execute($sql4);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250324110655InsertAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- }
|