M221108154153AlterQimallUserTeamStatistics.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. *
  6. * Class M221021021653AlterQimallUserTeamStatistics
  7. */
  8. class M221108154153AlterQimallUserTeamStatistics extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = "ALTER TABLE `qimall_user_team_statistics`";
  16. $sql.= "ADD COLUMN `team_finish_order_total` int(10) NULL DEFAULT 0 COMMENT '团队完成订单数量(不包括本人)',";
  17. $sql.= "ADD COLUMN `team_finish_order_price_total` decimal(12,2) NULL DEFAULT 0.00 COMMENT '团队完成订单金额(不包括本人)';";
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M221108154153AlterQimallUserTeamStatistics cannot be reverted.\n";
  26. return false;
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "M221021021653AlterQimallUserTeamStatistics cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }