M230218073428InsertQimallCrontabTask.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230218073427CreateQimallBalanceLogRelation
  6. */
  7. class M230218073428InsertQimallCrontabTask extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql ="INSERT INTO `qimall_crontab_task` ( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('薪资平台-每月统计', 'commission-month-billing/init', 2, '0 0 0 1 0 0', 0, 1, 1677828309, 1677828484)";
  16. $this->execute($sql);
  17. $sql = "INSERT INTO `qimall_crontab_task` ( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ( '薪资平台-每年统计', 'commission-years-billing/init', 2, '0 0 0 1 1 0', 0, 1, 1677828364, 1677828467)";
  18. $this->execute($sql);
  19. } catch (\Exception $e) {
  20. }
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M230218073427CreateQimallBalanceLogRelation cannot be reverted.\n";
  28. return false;
  29. }
  30. /*
  31. // Use up()/down() to run migration code without a transaction.
  32. public function up()
  33. {
  34. }
  35. public function down()
  36. {
  37. echo "M230218073427CreateQimallBalanceLogRelation cannot be reverted.\n";
  38. return false;
  39. }
  40. */
  41. }