data() as [$type, $title, $value, $isOther, $sort]) { $this->execute("INSERT INTO `oa_withdraw_cate` (`type`, `title`, `value`, `is_other`, `sort`, `status`, `create_time`, `delete_time`) VALUES ({$type}, '{$title}', {$value}, {$isOther}, {$sort}, 1, {$now}, 0)"); } } public function down(): void { foreach ($this->data() as [$type, $title]) { $this->execute("DELETE FROM `oa_withdraw_cate` WHERE `type` = {$type} AND `title` = '{$title}'"); } } /** * @return array [type, title, value, is_other, sort] */ protected function data(): array { return [ // 客户交易场景(type=1) [1, 'Facebook', 1, 0, 1], [1, '其他-需在备注中说明', 9, 1, 9], // 提现类型(type=2) [2, '清退提现(全额提现)', 1, 0, 1], [2, '部分提现', 2, 0, 2], ]; } }