M241012244504AgentMigrate.php 781 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. use common\models\common\CrontabTask;
  5. /**
  6. * Class M241012244504AgentMigrate
  7. */
  8. class M241012244504AgentMigrate extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $res = CrontabTask::findOne(['command'=>'agent/agent/delay']);
  16. if(empty($res)){
  17. $sql="INSERT INTO `qimall_crontab_task`( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('渠道分红延时结算', 'agent/agent/delay', 2, '0 */30 * * * *', 0, 1, 1735013591, 1735013591);";
  18. $this->execute($sql);
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. return false;
  27. }
  28. }