| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- use think\migration\Migrator;
- class SeedFeeRefundCateData extends Migrator
- {
- public function up(): void
- {
- $now = time();
- foreach ($this->data() as [$type, $title, $value, $isOther, $sort]) {
- $this->execute("INSERT INTO `oa_fee_refund_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_fee_refund_cate` WHERE `type` = {$type} AND `title` = '{$title}'");
- }
- }
- /**
- * @return array<int, array{0:int,1:string,2:int,3:int,4:int}> [type, title, value, is_other, sort]
- */
- protected function data(): array
- {
- return [
- // 费项维度(type=1,多选)
- [1, '账户', 1, 0, 1],
- [1, '卡', 2, 0, 2],
- // 退款项(type=2,单选)
- [2, '小额手续费', 1, 0, 1],
- [2, '失败手续费', 2, 0, 2],
- [2, '开卡手续费', 3, 0, 3],
- [2, '充值手续费', 4, 0, 4],
- [2, '退款手续费', 5, 0, 5],
- [2, '撤销手续费', 6, 0, 6],
- [2, '销卡退值金额', 7, 0, 7],
- [2, '其他-需备注说明', 9, 1, 9],
- // 退款原因(type=3,单选)
- [3, '约定,已过审批', 1, 0, 1],
- [3, '特殊情况', 2, 0, 2],
- ];
- }
- }
|