M220924092554InsertQimallGlobalVarMap.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220924092554InsertQimallGlobalVarMap
  6. */
  7. class M220924092554InsertQimallGlobalVarMap 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
  17. ('Agent', '渠道分红', 'FromTypeMap', 1, 1, 1654569888, 1654569888);
  18. ";
  19. $this->execute($sql);
  20. $sql = "
  21. INSERT INTO `qimall_global_var_map`( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`)
  22. VALUES ( 'team_achievement_extra', '渠道业绩额外奖励', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);
  23. ";
  24. $this->execute($sql);
  25. } catch (\Exception $e) {
  26. }
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. echo "M220924092554InsertQimallGlobalVarMap cannot be reverted.\n";
  34. return false;
  35. }
  36. /*
  37. // Use up()/down() to run migration code without a transaction.
  38. public function up()
  39. {
  40. }
  41. public function down()
  42. {
  43. echo "M220924092554InsertQimallGlobalVarMap cannot be reverted.\n";
  44. return false;
  45. }
  46. */
  47. }