M230116033141AddStoreSendCommissionToQimallAddonsStoreCommission.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230116033141AddStoreSendCommissionToQimallAddonsStoreCommission
  6. */
  7. class M230116033141AddStoreSendCommissionToQimallAddonsStoreCommission extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "ALTER TABLE `qimall_addons_store_commission`
  16. ADD COLUMN `store_send_commission` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '门店直接发放佣金,不包含平台设置的插件佣金' AFTER `settle_type`;";
  17. $this->execute($sql);
  18. }catch (\Exception $e){
  19. var_dump($e->getMessage());
  20. }
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M230116033141AddStoreSendCommissionToQimallAddonsStoreCommission cannot be reverted.\n";
  28. return false;
  29. }
  30. /*
  31. // Use up()/down() to run migration code without a transaction.
  32. public function up()
  33. {
  34. }
  35. public function down()
  36. {
  37. echo "M230116033141AddStoreSendCommissionToQimallAddonsStoreCommission cannot be reverted.\n";
  38. return false;
  39. }
  40. */
  41. }