M240723160955AlterAddonsStoreSettings.php 958 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use addons\Store\common\models\StoreAdmin;
  4. use yii\db\Migration;
  5. /**
  6. * Class M240723160955AlterAddonsStoreSettings
  7. */
  8. class M240723160955AlterAddonsStoreSettings extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql = <<<SQL
  17. ALTER TABLE `qimall_addons_store_settings`
  18. ADD COLUMN `is_customer` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否开启门店客服1 是 0 否' AFTER `cashier_is_open_discount`,
  19. ADD COLUMN `customer_types` text NULL COMMENT '门店客服显示字段' AFTER `is_customer`;
  20. SQL;
  21. $this->execute($sql);
  22. } catch (\Exception $e) {
  23. echo $e->getMessage();die();
  24. }
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function safeDown()
  30. {
  31. echo "M240723160955AlterAddonsStoreSettings cannot be reverted.\n";
  32. return false;
  33. }
  34. }