M230517085502AlterQimallGlobalVarMap.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230517085502AlterQimallGlobalVarMap
  6. */
  7. class M230517085502AlterQimallGlobalVarMap 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 ( 'consume_store_order', '门店订单消费', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);";
  16. $this->execute($sql);
  17. $sql="INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'consume_store_order_close', '门店订单关闭返还', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);";
  18. $this->execute($sql);
  19. $sql="INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'consume_store_order_refund', '门店订单退款返还', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);";
  20. $this->execute($sql);
  21. }catch (\Exception $e){
  22. }
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function safeDown()
  28. {
  29. echo "M230517085502AlterQimallGlobalVarMap 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 "M230517085502AlterQimallGlobalVarMap cannot be reverted.\n";
  40. return false;
  41. }
  42. */
  43. }