M202405071555UpdateCrontab.php 711 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace addons\GroupBuy\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M202405071555UpdateCrontab
  6. */
  7. class M202405071555UpdateCrontab extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "UPDATE `qimall_crontab_task`
  16. SET `rule` = '0 */30 * * * *'
  17. WHERE `command` = 'group-buy-order/auto-finish-active'";
  18. $this->execute($sql);
  19. } catch (\Exception $e) {
  20. }
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M202405071555UpdateCrontab cannot be reverted.\n";
  28. return false;
  29. }
  30. }