where(['command'=>'secondary-card/index-crontab/order-refund'])->one(); if(empty($res)) { $sql="INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ( '次卡过期检查', 'secondary-card/index-crontab/order-refund', 2, '0 */1 * * * *', 0, 1, 1710494060, 1710494060);"; $this->execute($sql); } $res = CrontabTask::find()->where(['command'=>'secondary-card/index-crontab/put-down'])->one(); if(empty($res)) { $sql=" INSERT INTO `qimall_crontab_task` ( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('次卡检查下架', 'secondary-card/index-crontab/put-down', 2, '0 */1 * * * *', 0, 1, 1712718662, 1712718662); "; $this->execute($sql); } } /** * {@inheritdoc} */ public function safeDown() { echo "M240320021647InsertTask cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M240320021647InsertTask cannot be reverted.\n"; return false; } */ }