| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230708011241InsertStoreMenu
- */
- class M230708011241InsertStoreMenu extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql="DELETE FROM qimall_addons_store_menu where url = 'store/client/setting/merchant';";
- $this->execute($sql);
- // 插入表数据
- $sql = "
- INSERT INTO qimall_addons_store_menu
- SET `title` = '商户号设置',
- `app_id` = 0,
- `pid` = 8,
- `url` = 'store/client/merchant/setting',
- `level` = 2,
- `sort` = 999,
- `created_at` = 1679384514,
- `updated_at` = 1679384514,
- `id` = 39
- ";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230708011241InsertStoreMenu cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230708011241InsertStoreMenu cannot be reverted.\n";
- return false;
- }
- */
- }
|