M230411065401AddTaskOnCrontabTask.php 844 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230411065401AddTaskOnCrontabTask
  6. */
  7. class M230411065401AddTaskOnCrontabTask extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $this->execute("INSERT INTO `qimall_crontab_task`( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('发放门店股东分红佣金定时任务', 'store/store-boss-crontab/mall-send-commission', 2, '0 31 0 * * *', 0, 1, 1681196194, 1681196194);");
  16. }catch (\Exception $e){
  17. var_dump($e->getMessage());
  18. }
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M230411065401AddTaskOnCrontabTask cannot be reverted.\n";
  26. return false;
  27. }
  28. }