| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M220908060913InsertQimallAddonsStoreMenu
- */
- class M220908060913InsertQimallAddonsStoreMenu extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $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 (26, '优惠券', '0', 8, 'store/client/coupon/index', '', 2, 0, 999, NULL, '', 1, 0, 0)";
- $this->execute($sql);
- $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 (27, '优惠券管理', '0', 26, 'store/client/coupon/index', '', 2, 0, 999, NULL, '', 1, 0, 0)";
- $this->execute($sql);
- $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 (28, '会员优惠券', '0', 26, 'store/client/coupon/user-coupon', '', 2, 0, 999, NULL, '', 1, 0, 0)";
- $this->execute($sql);
- $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 (30, '优惠设置', '0', 8, 'store/client/discount/index', '', 2, 0, 999, NULL, '', 1, 0, 0)";
- $this->execute($sql);
- }catch (\Exception $e){
- var_dump($e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M220908060913InsertQimallAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M220908060913InsertQimallAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- */
- }
|