| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace addons\StoreBoss\console\migrations;
- use addons\Store\common\models\StoreMenu;
- use yii\db\Migration;
- /**
- * Class M230906151123InsertQimallAddonsStoreMenu
- */
- class M230906151123InsertQimallAddonsStoreMenu extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $has = StoreMenu::find()->where(['title' => '股东', 'url' => 'store/client/store-boss/index', 'status' => 1])->asArray()->one();
- if (empty($has)) {
- $sql = "INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (34, '股东', '0', '0', 'store/client/store-boss/index', 'el-icon-circle-plus', '1', '0', '999', null, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (35, '股东列表', '0', '34', 'store/client/store-boss/index', '', '1', '0', '999', null, '',1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (36, '股东等级', '0', '34', 'store/client/store-boss-level/index', '', '1', '0', '999', null, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (37, '提成明细', '0', '34', 'store/client/store-boss/settlement-list', '', '1', '0', '999', null, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (38, '基础配置', '0', '34', 'store/client/store-boss/setting', '', '1', '0', '999', null, '', 1, 0, 0);
- ";
- $this->execute($sql);
- }
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230906151123InsertQimallAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230906151123InsertQimallAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- */
- }
|