# Generated by Django 4.2.27 on 2026-03-17 13:49

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


class Migration(migrations.Migration):

    dependencies = [
        ("yonghu", "0026_tixianautorecord_alter_userdashou_options_and_more"),
    ]

    operations = [
        migrations.AddField(
            model_name="userguanshi",
            name="yaoqingren",
            field=models.CharField(
                db_index=True, max_length=7, null=True, verbose_name="邀请人ID"
            ),
        ),
        migrations.CreateModel(
            name="UserZuzhang",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "yaoqingma",
                    models.CharField(
                        db_index=True,
                        max_length=20,
                        null=True,
                        verbose_name="组长邀请码",
                    ),
                ),
                (
                    "fenyong_zonge",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="分佣总额(元)",
                    ),
                ),
                (
                    "ketixian_jine",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="可提现金额(元)",
                    ),
                ),
                (
                    "yaoqing_zongshu",
                    models.IntegerField(default=0, verbose_name="邀请总数"),
                ),
                (
                    "jinri_fenyong",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="今日分佣(元)",
                    ),
                ),
                (
                    "jinyue_fenyong",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="今月分佣(元)",
                    ),
                ),
                (
                    "zhuangtai",
                    models.IntegerField(
                        choices=[(0, "禁用"), (1, "正常")],
                        default=1,
                        verbose_name="账号状态",
                    ),
                ),
                (
                    "haibao_url",
                    models.CharField(
                        blank=True,
                        max_length=500,
                        null=True,
                        verbose_name="推广海报相对URL",
                    ),
                ),
                (
                    "jinri_tixian",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="今日提现金额(元)",
                    ),
                ),
                (
                    "last_tixian_time",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="最后提现时间"
                    ),
                ),
                (
                    "ewai_tixian_xiane",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="额外提现限额(元)",
                    ),
                ),
                (
                    "kaioi_ewai_tixian",
                    models.BooleanField(default=False, verbose_name="开启额外提现"),
                ),
                (
                    "kaioi_ewai_fenhong",
                    models.BooleanField(default=False, verbose_name="开启额外分红"),
                ),
                (
                    "ewai_fenhong_jine",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="额外分红金额(元)",
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="zuzhang_profile",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="关联用户",
                    ),
                ),
            ],
            options={
                "verbose_name": "组长扩展表",
                "verbose_name_plural": "组长扩展表",
                "db_table": "user_zuzhang",
                "indexes": [
                    models.Index(
                        fields=["user"], name="user_zuzhan_user_id_8064f2_idx"
                    ),
                    models.Index(
                        fields=["yaoqingma"], name="user_zuzhan_yaoqing_cba91d_idx"
                    ),
                ],
            },
        ),
    ]
