M250603015311CreateQimallUserTeamProfitStatistics.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250603015311CreateQimallUserTeamProfitStatistics
  6. */
  7. class M250603015311CreateQimallUserTeamProfitStatistics extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_user_team_profit_statistics` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  16. `mall_id` int(11) NOT NULL COMMENT '商城id',
  17. `user_id` int(11) NOT NULL COMMENT '用户id',
  18. `children_order_pay_profit` decimal(16,2) NOT NULL COMMENT '下级团队订单支付总利润(不包含自己)',
  19. `team_order_pay_profit` decimal(16,2) NOT NULL COMMENT '团队订单支付总利润(包含自己)',
  20. `children_order_finish_profit` decimal(16,2) NOT NULL COMMENT '下级团队订单完成总利润(不包含自己)',
  21. `team_order_finish_profit` decimal(16,2) NOT NULL COMMENT '团队订单完成总利润(包含自己)',
  22. `created_at` int(11) DEFAULT NULL COMMENT '添加时间',
  23. `updated_at` int(11) DEFAULT NULL COMMENT '修改时间',
  24. PRIMARY KEY (`id`)
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户团队订单利润统计表';";
  26. $this->execute($sql);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. echo "M250603015311CreateQimallUserTeamProfitStatistics cannot be reverted.\n";
  34. return false;
  35. }
  36. /*
  37. // Use up()/down() to run migration code without a transaction.
  38. public function up()
  39. {
  40. }
  41. public function down()
  42. {
  43. echo "M250603015311CreateQimallUserTeamProfitStatistics cannot be reverted.\n";
  44. return false;
  45. }
  46. */
  47. }