M230718020309InsertQimallGlobalVarMap.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230718020309InsertQimallGlobalVarMap
  6. */
  7. class M230718020309InsertQimallGlobalVarMap 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 ('fill_price_difference', '补货差价', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);";
  16. $this->execute($sql);
  17. $sql="
  18. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'first_equal', '直推平级奖', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);
  19. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'first_over', '直推越级奖', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);
  20. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'second_equal', '间推平级奖', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);
  21. INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'second_over', '直推越级奖', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);
  22. ";
  23. $this->execute($sql);
  24. $sql="INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'payment_for_level_goods_buy', '升级礼包赠送库存货款', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);
  25. ";
  26. $this->execute($sql);
  27. }catch (\Exception $e){
  28. }
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function safeDown()
  34. {
  35. echo "M230718020309InsertQimallGlobalVarMap cannot be reverted.\n";
  36. return false;
  37. }
  38. /*
  39. // Use up()/down() to run migration code without a transaction.
  40. public function up()
  41. {
  42. }
  43. public function down()
  44. {
  45. echo "M230718020309InsertQimallGlobalVarMap cannot be reverted.\n";
  46. return false;
  47. }
  48. */
  49. }