M250604021553AddQimallUserProfitStatisticsData.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\migrations;
  3. use common\enums\RabbitMqEnum;
  4. use common\models\user\UserTeamProfitStatistics;
  5. use yii\db\Migration;
  6. /**
  7. * Class M250604021553AddQimallUserProfitStatisticsData
  8. */
  9. class M250604021553AddQimallUserProfitStatisticsData extends Migration
  10. {
  11. /**
  12. * {@inheritdoc}
  13. */
  14. public function safeUp()
  15. {
  16. //处理累计历史订单利润数据
  17. \Yii::$app->services->rabbitMq->push(RabbitMqEnum::EXCHANGE_LONG_DURATION, RabbitMqEnum::LONG_DURATION_QUEUE,
  18. ['type' => 1], UserTeamProfitStatistics::class, 'cumulativeOrderProfit');
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M250604021553AddQimallUserProfitStatisticsData 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 "M250604021553AddQimallUserProfitStatisticsData cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }