M221226065640InsertIntoQimallGlobalVarMap.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M221226065640InsertIntoQimallGlobalVarMap
  6. */
  7. class M221226065640InsertIntoQimallGlobalVarMap extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql="
  16. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'extra_equal_1', '额外平1级', 'CapitalTypeMap', 0, 1, 0, 0);
  17. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'extra_equal_2', '额外平2级', 'CapitalTypeMap', 0, 1, 0, 0);
  18. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'drainage_subsidy', '引流补贴', 'CapitalTypeMap', 0, 1, 0, 0);
  19. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'team_subsidy', '渠道补贴', 'CapitalTypeMap', 0, 1, 0, 0);
  20. ";
  21. $this->execute($sql);
  22. } catch (\Exception $e) {
  23. }
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function safeDown()
  29. {
  30. echo "M221226065640InsertIntoQimallGlobalVarMap cannot be reverted.\n";
  31. return false;
  32. }
  33. /*
  34. // Use up()/down() to run migration code without a transaction.
  35. public function up()
  36. {
  37. }
  38. public function down()
  39. {
  40. echo "M221226065640InsertIntoQimallGlobalVarMap cannot be reverted.\n";
  41. return false;
  42. }
  43. */
  44. }