M220810084004InsertQimallCrontabTask.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace addons\LuckyGroup\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220810084004InsertQimallCrontabTask
  6. */
  7. class M220810084004InsertQimallCrontabTask extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. }
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function safeDown()
  19. {
  20. echo "M220810084004InsertQimallCrontabTask cannot be reverted.\n";
  21. return false;
  22. }
  23. // Use up()/down() to run migration code without a transaction.
  24. public function up()
  25. {
  26. //`id`, `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`
  27. $this->insert('qimall_crontab_task', [
  28. 'name' => '幸运拼团手动拼团订单过了有效期自动退款',
  29. 'command' => 'lucky-group/lucky-group-crontab/exp-activity',
  30. 'type' => 2,
  31. 'rule' => '0 30 0 * * *',
  32. 'is_warning' => 0,
  33. 'status' => 1,
  34. 'created_at' => 1660120549,
  35. 'updated_at' => 1660120549,
  36. ]);
  37. }
  38. public function down()
  39. {
  40. echo "M220810084004InsertQimallCrontabTask cannot be reverted.\n";
  41. return false;
  42. }
  43. }