M220902065257InsterQimalGlobalVarMap.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace addons\OperatingNote\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220902065257InsterQimalGlobalVarMap
  6. */
  7. class M220902065257InsterQimalGlobalVarMap extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try{
  15. $sql = "INSERT INTO `qimall_global_var_map`(`name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ";
  16. $sql .= "('OperatingNote', '运营笔记', 'IncomeMap', 1, 1, 1654569888, 1654569888),";
  17. $sql .= "('OperatingNote', '运营笔记', 'FromTypeMap', 1, 1, 1654569888, 1654569888),";
  18. $sql .= "('operating_note_share', '运营笔记分享奖励', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888),";
  19. $sql .= "('operating_note_view', '运营笔记浏览奖励', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888),";
  20. $sql .= "('operating_note_buy', '运营笔记购买', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);";
  21. $this->execute($sql);
  22. }catch (\Exception $e){}
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function safeDown()
  28. {
  29. echo "M220902065257InsterQimalGlobalVarMap cannot be reverted.\n";
  30. return false;
  31. }
  32. /*
  33. // Use up()/down() to run migration code without a transaction.
  34. public function up()
  35. {
  36. }
  37. public function down()
  38. {
  39. echo "M220902065257InsterQimalGlobalVarMap cannot be reverted.\n";
  40. return false;
  41. }
  42. */
  43. }