M230323145234InsertTableStoreMenu.php 955 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace addons\YunfastPay\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230323145234InsertTableStoreMenu
  6. */
  7. class M230323145234InsertTableStoreMenu extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. // 插入表数据
  16. $sql = "
  17. INSERT INTO qimall_addons_store_menu
  18. SET `title` = '商户号设置',
  19. `app_id` = 0,
  20. `pid` = 8,
  21. `url` = 'store/client/setting/merchant',
  22. `level` = 2,
  23. `sort` = 999,
  24. `created_at` = 1679384514,
  25. `updated_at` = 1679384514,
  26. `id` = 39
  27. ";
  28. $this->execute($sql);
  29. } catch (\Exception $e) {
  30. }
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function safeDown()
  36. {
  37. echo "M230323145234InsertTableStoreMenu cannot be reverted.\n";
  38. return false;
  39. }
  40. }