| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace addons\ServeBonus\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230401160820CreateQimallAddonsServebonusUpgradeTable
- */
- class M230401160820CreateQimallAddonsServebonusUpgradeTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_servebonus_upgrade_count` (
- `id` int(10) NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) DEFAULT '0' COMMENT '商城ID',
- `user_id` int(10) DEFAULT '0' COMMENT '服务商ID',
- `direct_num` int(10) DEFAULT '0' COMMENT '好友人数',
- `achievement` decimal(10,2) DEFAULT '0.00' COMMENT '服务商团队业绩,单位:元',
- `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `user_id` (`user_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='服务商团队业绩统计表';";
- $sql .= "CREATE TABLE `qimall_addons_servebonus_upgrade_direct` (
- `id` int(10) NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) DEFAULT '0' COMMENT '商城ID',
- `user_id` int(10) DEFAULT '0' COMMENT '用户ID',
- `recommend_uid` int(4) DEFAULT '0' COMMENT '被推荐的用户',
- `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `user_id` (`user_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='服务商直推升级限制表';";
- $sql .= "CREATE TABLE `qimall_addons_servebonus_upgrade_limit` (
- `id` int(10) NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) DEFAULT '0' COMMENT '商城ID',
- `user_id` int(10) DEFAULT '0' COMMENT '消费者ID',
- `serve_uid` int(4) DEFAULT '0' COMMENT '消费者上级ID',
- `level` tinyint(4) DEFAULT '0' COMMENT '消费者上级等级',
- `achievement` decimal(10,2) DEFAULT '0.00' COMMENT '为上级贡献的业绩,单位:元',
- `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `user_id+serve_uid` (`user_id`,`serve_uid`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='服务商团队业绩升级限制表';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230401160820CreateQimallAddonsServebonusUpgradeTable cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230401160820CreateQimallAddonsServebonusUpgradeTable cannot be reverted.\n";
- return false;
- }
- */
- }
|