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

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('products', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='DianpuMorenPeizhi',
            fields=[
                ('id', models.PositiveSmallIntegerField(default=1, editable=False, primary_key=True, serialize=False)),
                ('moren_choucheng_feilv', models.DecimalField(decimal_places=4, default=0.1, max_digits=5, verbose_name='默认订单抽成费率（小数，0.1000=10%）')),
                ('moren_tixian_xiane', models.DecimalField(decimal_places=2, default=1000.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': 'dianpu_moren_peizhi',
            },
        ),
        migrations.CreateModel(
            name='DianpuShangpinShenheShezhi',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('kaiqi_shenhe', models.BooleanField(default=False, 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': 'dianpu_shangpin_shenhe_shezhi',
            },
        ),
        migrations.CreateModel(
            name='YonghuPingzheng',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='自增主键ID')),
                ('yonghu', models.CharField(db_index=True, max_length=7, unique=True, verbose_name='关联用户ID')),
                ('zhanghao', models.CharField(db_index=True, max_length=50, unique=True, verbose_name='登录账号')),
                ('mima', models.CharField(max_length=255, verbose_name='密码')),
                ('is_active', models.BooleanField(default=True, 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': 'yonghu_pingzheng',
            },
        ),
        migrations.CreateModel(
            name='DianpuShouzhiMeiriTongji',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dianpu_id', models.PositiveIntegerField(db_index=True, verbose_name='店铺ID')),
                ('riqi', models.DateField(db_index=True, verbose_name='统计日期')),
                ('nian', models.PositiveSmallIntegerField(verbose_name='年份')),
                ('yue', models.PositiveSmallIntegerField(verbose_name='月份')),
                ('ri', models.PositiveSmallIntegerField(verbose_name='日')),
                ('xiadan_zongliang', models.PositiveIntegerField(default=0, verbose_name='下单总量')),
                ('xiadan_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='下单总额')),
                ('chengjiao_zongliang', models.PositiveIntegerField(default=0, verbose_name='成交总量')),
                ('chengjiao_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='成交总额')),
                ('tuikuan_zongliang', models.PositiveIntegerField(default=0, verbose_name='退款总量')),
                ('tuikuan_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='退款总额')),
                ('shouyi_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='收益总额')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('shangji_fenhong_cishu', models.PositiveIntegerField(default=0, verbose_name='作为上级获得分红次数')),
                ('shangji_fenhong_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='作为上级获得分红总额')),
                ('shangji_id', models.PositiveIntegerField(blank=True, null=True, verbose_name='当天对应的上级店铺ID（若无则为空）')),
                ('gei_shangji_cishu', models.PositiveIntegerField(default=0, verbose_name='给上级分红次数')),
                ('gei_shangji_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='给上级分红总额')),
            ],
            options={
                'verbose_name': '店铺每日收支统计',
                'verbose_name_plural': '店铺每日收支统计',
                'db_table': 'dianpu_shouzhi_meiri_tongji',
                'indexes': [models.Index(fields=['dianpu_id', 'riqi'], name='dianpu_shou_dianpu__bffdb2_idx'), models.Index(fields=['nian', 'yue', 'ri'], name='dianpu_shou_nian_a0f415_idx')],
                'unique_together': {('dianpu_id', 'riqi')},
            },
        ),
        migrations.CreateModel(
            name='Dianpu',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='店铺自增ID')),
                ('dianpu_mingcheng', models.CharField(max_length=50, verbose_name='店铺名称')),
                ('dianpu_touxiang', models.CharField(blank=True, max_length=500, null=True, verbose_name='店铺头像URL')),
                ('lianxi_dianhua', models.CharField(blank=True, max_length=20, null=True, verbose_name='联系电话')),
                ('weixinhao', models.CharField(blank=True, max_length=50, null=True, verbose_name='微信号')),
                ('zhuangtai', models.IntegerField(choices=[(0, '封禁'), (1, '正常')], default=1, verbose_name='店铺状态')),
                ('bangding_yonghushu', models.PositiveIntegerField(default=0, verbose_name='绑定用户总数')),
                ('erweima_url', models.CharField(blank=True, max_length=500, null=True, verbose_name='店铺二维码相对URL')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('kaiqi_shouyi_choucheng', models.BooleanField(default=False, verbose_name='是否开启店铺订单收益抽成')),
                ('shouyi_choucheng_feilv', models.DecimalField(blank=True, decimal_places=4, default=0.0, max_digits=5, null=True, verbose_name='店铺订单收益抽成费率（小数，如0.1000=10%）')),
                ('ketixian_yue', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='店铺可提现余额')),
                ('zhengqu_zonge', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='店铺赚取总额')),
                ('meiri_tixian_xiane', models.DecimalField(blank=True, decimal_places=2, default=0.0, max_digits=10, null=True, verbose_name='店铺每日提现限额')),
                ('kaiqi_meiri_xiane', models.BooleanField(default=False, verbose_name='是否开启每日提现限额')),
                ('yaoqing_dianpu_id', models.PositiveIntegerField(blank=True, db_index=True, null=True, verbose_name='邀请人店铺ID(上级)')),
                ('fenhong_choucheng_feilv', models.DecimalField(blank=True, decimal_places=4, default=0.05, max_digits=5, null=True, verbose_name='上级分红抽成费率(默认5%)')),
                ('shangji_fenhong_leiji', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='作为上级累计获得分红')),
                ('shangji_ketixian_fenhong', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='作为上级可提现分红余额')),
                ('pingzheng', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='shop.yonghupingzheng', verbose_name='关联用户凭证')),
            ],
            options={
                'verbose_name': '平台商家店铺',
                'verbose_name_plural': '平台商家店铺',
                'db_table': 'dianpu',
            },
        ),
        migrations.CreateModel(
            name='YonghuDianpuBangding',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='绑定自增ID')),
                ('CreateTime', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('UpdateTime', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('dianpu', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.dianpu', verbose_name='关联店铺ID')),
                ('yonghu', models.ForeignKey(db_column='UserUUID', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户ID')),
            ],
            options={
                'verbose_name': '用户店铺绑定关系',
                'verbose_name_plural': '用户店铺绑定关系',
                'db_table': 'yonghu_dianpu_bangding',
                'unique_together': {('yonghu', 'dianpu')},
            },
        ),
        migrations.CreateModel(
            name='ShangpinLeixingDianpu',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='类型自增ID')),
                ('jieshao', models.CharField(max_length=45, verbose_name='类型介绍')),
                ('tupian_url', models.CharField(blank=True, max_length=500, null=True, verbose_name='类型图片URL')),
                ('paixu', models.IntegerField(default=0, verbose_name='排序权重')),
                ('shangjia_zhuangtai', models.BooleanField(default=True, verbose_name='是否上架')),
                ('fengjin_zhuangtai', models.BooleanField(default=False, verbose_name='是否封禁')),
                ('shenhe_zhuangtai', models.BooleanField(default=False, help_text='True=审核通过，False=未审核', verbose_name='平台审核状态')),
                ('dianpu', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.dianpu', verbose_name='所属店铺')),
                ('gonggong_leixing', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.shangpinleixing', verbose_name='映射的公共商品类型')),
            ],
            options={
                'verbose_name': '店铺商品类型映射',
                'verbose_name_plural': '店铺商品类型映射',
                'db_table': 'shangdian_shangpin_leixing',
                'indexes': [models.Index(fields=['dianpu'], name='shangdian_s_dianpu__100f93_idx'), models.Index(fields=['gonggong_leixing'], name='shangdian_s_gonggon_88a9a0_idx')],
            },
        ),
    ]
