# Generated by Django 4.2.27 on 2026-06-17 21:18

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Gonggao',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('leixing', models.IntegerField(blank=True, null=True, verbose_name='公告类型')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更改时间')),
                ('jieshao', models.TextField(blank=True, null=True, verbose_name='公告介绍')),
            ],
            options={
                'verbose_name': '公告',
                'verbose_name_plural': '公告',
                'db_table': 'gonggao',
            },
        ),
        migrations.CreateModel(
            name='Lunbo',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tupian_url', models.CharField(blank=True, max_length=500, null=True, verbose_name='轮播图片URL')),
                ('leixing', models.IntegerField(blank=True, null=True, verbose_name='图片类型:1：轮播2：个人中心背景')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更改时间')),
            ],
            options={
                'verbose_name': '轮播',
                'verbose_name_plural': '轮播',
                'db_table': 'lunbo',
            },
        ),
        migrations.CreateModel(
            name='PopupConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('popup_id', models.CharField(max_length=50, verbose_name='弹窗唯一ID')),
                ('title', models.CharField(blank=True, max_length=200, verbose_name='标题（后台用）')),
                ('description', models.TextField(blank=True, verbose_name='描述（后台用）')),
                ('strategy_type', models.CharField(choices=[('once', '仅一次'), ('daily', '每日'), ('weekly', '每周'), ('monthly', '每月'), ('yearly', '每年'), ('always', '始终'), ('count', '周期内次数限制')], default='once', max_length=20)),
                ('max_count', models.PositiveIntegerField(default=1, verbose_name='周期内最大展示次数')),
                ('reset_interval', models.CharField(blank=True, choices=[('day', '天'), ('week', '周'), ('month', '月'), ('year', '年')], max_length=20, verbose_name='重置周期（count类型时使用）')),
                ('duration', models.PositiveIntegerField(default=0, verbose_name='强制阅读秒数（0=无强制）')),
                ('force_even_muted', models.BooleanField(default=False, verbose_name='强制弹出（忽略用户今日屏蔽）')),
                ('sort_order', models.PositiveIntegerField(default=0, verbose_name='展示顺序')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('start_time', models.DateTimeField(blank=True, null=True, verbose_name='生效开始时间')),
                ('end_time', models.DateTimeField(blank=True, null=True, verbose_name='生效结束时间')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': '弹窗配置',
                'verbose_name_plural': '弹窗配置',
                'db_table': 'popup_config',
                'ordering': ['sort_order', 'id'],
            },
        ),
        migrations.CreateModel(
            name='PopupPage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('page_key', models.CharField(db_index=True, max_length=50, unique=True, verbose_name='页面标识')),
                ('name', models.CharField(max_length=100, verbose_name='页面名称')),
                ('description', models.TextField(blank=True, verbose_name='描述')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('ignore_user_mute', models.BooleanField(default=False, verbose_name='忽略用户今日屏蔽')),
            ],
            options={
                'verbose_name': '弹窗页面',
                'verbose_name_plural': '弹窗页面',
                'db_table': 'popup_page',
            },
        ),
        migrations.CreateModel(
            name='Qunpeizhi',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('peizhiid', models.IntegerField(blank=True, null=True, verbose_name='群类型:1.打手 2.管事')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更改时间')),
                ('neirong', models.CharField(blank=True, max_length=200, null=True, verbose_name='群介绍')),
                ('qunid', models.CharField(blank=True, max_length=100, null=True, verbose_name='群id')),
                ('jieshao', models.CharField(blank=True, max_length=200, null=True, verbose_name='介绍')),
            ],
            options={
                'db_table': 'qunpeizhi',
            },
        ),
        migrations.CreateModel(
            name='Szjilu',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='记录ID')),
                ('zongsy', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='总收益')),
                ('zongls', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='总流水')),
                ('zongzc', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='总支出')),
                ('jrzc', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='今日支出')),
                ('jrls', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='今日流水')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更改时间')),
            ],
            options={
                'verbose_name': '收支记录',
                'verbose_name_plural': '收支记录',
                'db_table': 'szjilu',
            },
        ),
        migrations.CreateModel(
            name='TixianQuotaDefault',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('leixing', models.IntegerField(choices=[(1, '打手'), (2, '管事'), (3, '组长'), (4, '考核官'), (5, '打手押金'), (6, '商家余额')], unique=True, verbose_name='用户类型')),
                ('default_quota', models.DecimalField(decimal_places=2, default=20.0, max_digits=10, verbose_name='默认每日提现限额(元)')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '默认提现限额',
                'verbose_name_plural': '默认提现限额',
                'db_table': 'tixian_quota_default',
            },
        ),
        migrations.CreateModel(
            name='Tupianpeizhi',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tupian', models.CharField(blank=True, max_length=500, null=True, verbose_name='配置图片URL')),
                ('leixing', models.PositiveIntegerField(blank=True, null=True, verbose_name='提现类型1:打手规则图片2：默认头像图片')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更改时间')),
                ('fangwen_cishu', models.PositiveIntegerField(default=0, verbose_name='访问次数')),
            ],
            options={
                'verbose_name': '配置图片',
                'verbose_name_plural': '配置图片',
                'db_table': 'tupianpeizhi',
            },
        ),
        migrations.CreateModel(
            name='WithdrawConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mode', models.IntegerField(choices=[(1, '自动提现'), (2, '手动提现')], default=2, verbose_name='提现模式')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '提现模式配置',
                'verbose_name_plural': '提现模式配置',
                'db_table': 'withdraw_config',
            },
        ),
        migrations.CreateModel(
            name='ShangjiaMoban',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='模板ID')),
                ('yonghu_id', models.CharField(db_index=True, max_length=7, verbose_name='用户ID')),
                ('leixing_id', models.PositiveIntegerField(db_index=True, verbose_name='商品类型ID')),
                ('moban_jieshao', models.CharField(max_length=500, verbose_name='模板介绍')),
                ('jiage', models.DecimalField(decimal_places=2, help_text='单位：元', max_digits=10, verbose_name='模板价格')),
                ('fabu_shuliang', models.PositiveIntegerField(default=0, verbose_name='发布数量')),
                ('yongjin_qiangdan', models.BooleanField(default=False, verbose_name='是否开启佣金抢单')),
                ('yongjin_jiage', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='佣金价格')),
                ('chenghao_id', models.IntegerField(blank=True, null=True, verbose_name='关联称号ID')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '商家订单模板',
                'verbose_name_plural': '商家订单模板',
                'db_table': 'shangjia_moban',
                'indexes': [models.Index(fields=['yonghu_id', 'leixing_id'], name='shangjia_mo_yonghu__bb287d_idx'), models.Index(fields=['yonghu_id', 'leixing_id', 'id'], name='shangjia_mo_yonghu__4240d0_idx')],
                'unique_together': {('yonghu_id', 'leixing_id', 'moban_jieshao')},
            },
        ),
        migrations.CreateModel(
            name='ShangjiaLianjie',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='链接ID')),
                ('yonghu_id', models.CharField(db_index=True, max_length=7, verbose_name='用户ID')),
                ('leixing_id', models.PositiveIntegerField(db_index=True, verbose_name='商品类型ID')),
                ('moban_id', models.PositiveIntegerField(db_index=True, verbose_name='模板ID')),
                ('lianjie', models.CharField(max_length=500, unique=True, verbose_name='链接地址')),
                ('dingdan_id', models.CharField(blank=True, db_index=True, max_length=32, null=True, verbose_name='订单ID')),
                ('is_used', models.BooleanField(db_index=True, default=False, verbose_name='是否已使用')),
                ('shiyongzhe_ip', models.CharField(blank=True, max_length=50, null=True, verbose_name='使用者IP')),
                ('youxiao_shijian', models.DateTimeField(blank=True, null=True, verbose_name='有效截止时间')),
                ('lianjie_token', models.CharField(blank=True, db_index=True, max_length=32, null=True, unique=True, verbose_name='链接Token')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('previous_lianjie_id', models.PositiveIntegerField(blank=True, db_index=True, null=True, verbose_name='上一个链接ID')),
                ('previous_dingdan_id', models.CharField(blank=True, db_index=True, max_length=32, null=True, verbose_name='上一个订单ID')),
            ],
            options={
                'verbose_name': '商家链接',
                'verbose_name_plural': '商家链接',
                'db_table': 'shangjia_lianjie',
                'indexes': [models.Index(fields=['yonghu_id', 'moban_id', 'leixing_id'], name='shangjia_li_yonghu__9f2b25_idx'), models.Index(fields=['lianjie_token'], name='shangjia_li_lianjie_99014c_idx'), models.Index(fields=['dingdan_id'], name='shangjia_li_dingdan_95b682_idx')],
            },
        ),
        migrations.CreateModel(
            name='PopupImage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image_url', models.CharField(max_length=500, verbose_name='图片相对路径')),
                ('text', models.TextField(blank=True, verbose_name='图片上方文字')),
                ('sort_order', models.PositiveIntegerField(default=0, verbose_name='展示顺序')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('popup_config', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='config.popupconfig')),
            ],
            options={
                'verbose_name': '弹窗图片',
                'verbose_name_plural': '弹窗图片',
                'db_table': 'popup_image',
                'ordering': ['sort_order', 'id'],
            },
        ),
        migrations.AddField(
            model_name='popupconfig',
            name='page',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='popups', to='config.popuppage'),
        ),
        migrations.CreateModel(
            name='DailyPayoutStat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(db_index=True, unique=True, verbose_name='统计日期')),
                ('year', models.PositiveSmallIntegerField(verbose_name='年份')),
                ('month', models.PositiveSmallIntegerField(verbose_name='月份')),
                ('day', models.PositiveSmallIntegerField(verbose_name='日期')),
                ('total_amount', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='出款总额')),
                ('total_count', models.PositiveIntegerField(default=0, verbose_name='出款总笔数')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '每日出款统计',
                'verbose_name_plural': '每日出款统计',
                'db_table': 'daily_payout_stat',
                'indexes': [models.Index(fields=['date'], name='daily_payou_date_b534ec_idx'), models.Index(fields=['year', 'month', 'day'], name='daily_payou_year_6376ca_idx')],
            },
        ),
        migrations.CreateModel(
            name='DailyIncomeStat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(db_index=True, unique=True, verbose_name='统计日期')),
                ('year', models.PositiveSmallIntegerField(verbose_name='年份')),
                ('month', models.PositiveSmallIntegerField(verbose_name='月份')),
                ('day', models.PositiveSmallIntegerField(verbose_name='日期')),
                ('total_amount', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='总收入金额')),
                ('total_count', models.PositiveIntegerField(default=0, verbose_name='总收入笔数')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '每日收入统计',
                'verbose_name_plural': '每日收入统计',
                'db_table': 'daily_income_stat',
                'indexes': [models.Index(fields=['date'], name='daily_incom_date_75e6df_idx'), models.Index(fields=['year', 'month', 'day'], name='daily_incom_year_d85d10_idx')],
            },
        ),
        migrations.CreateModel(
            name='AccountPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('account_id', models.CharField(db_index=True, max_length=11, verbose_name='账号ID')),
                ('permission_code', models.IntegerField(verbose_name='权限代码')),
                ('is_enabled', models.BooleanField(default=False, verbose_name='是否开启')),
            ],
            options={
                'verbose_name': '账号权限',
                'verbose_name_plural': '账号权限',
                'db_table': 'account_permission',
                'unique_together': {('account_id', 'permission_code')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='popupconfig',
            unique_together={('page', 'popup_id')},
        ),
    ]
