db->createCommand("select * from qimall_crontab_task where `command` IN ('business-activity/activity/sign-in-expire', 'business-activity/activity/activity-finish') ")->queryAll(); if($list && count($list) == 2) return true; $this->execute("INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('招商活动 - 定时解除绑定关系', 'business-activity/activity/sign-in-expire', 2, '0 */1 * * * *', 0, 1, 1678879219, 1678879219);"); $this->execute("INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('招商活动 - 定时启用/结束', 'business-activity/activity/activity-finish', 2, '0 */1 * * * *', 0, 1, 1678879140, 1678879140);"); } /** * {@inheritdoc} */ public function safeDown() { echo "M230705071957BusinessActivityCrontabTask cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230705071957BusinessActivityCrontabTask cannot be reverted.\n"; return false; } */ }