# Generated by Django 4.2.27 on 2026-03-18 21:00

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


class Migration(migrations.Migration):

    dependencies = [
        ("shangpin", "0012_alter_gsfenhong_dashouid"),
    ]

    operations = [
        migrations.AddField(
            model_name="gsfenhong",
            name="huiyuan_id",
            field=models.CharField(
                blank=True, max_length=6, null=True, verbose_name="会员ID"
            ),
        ),
        migrations.AddField(
            model_name="gsfenhong",
            name="zuzhang_fenhong",
            field=models.DecimalField(
                blank=True,
                decimal_places=2,
                max_digits=10,
                null=True,
                verbose_name="组长分红金额",
            ),
        ),
        migrations.AddField(
            model_name="gsfenhong",
            name="zuzhang_id",
            field=models.CharField(
                blank=True,
                db_index=True,
                max_length=7,
                null=True,
                verbose_name="组长ID",
            ),
        ),
        migrations.AddField(
            model_name="huiyuan",
            name="zuzhangfc",
            field=models.DecimalField(
                decimal_places=2, default=0.0, max_digits=10, verbose_name="组长分成"
            ),
        ),
        migrations.CreateModel(
            name="DuociFenhong",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "guanshi",
                    models.CharField(
                        db_index=True, max_length=7, verbose_name="管事ID"
                    ),
                ),
                (
                    "zuzhang",
                    models.CharField(
                        blank=True,
                        db_index=True,
                        max_length=7,
                        null=True,
                        verbose_name="组长ID",
                    ),
                ),
                ("cishu", models.PositiveIntegerField(verbose_name="分红次数")),
                (
                    "guanshi_fenhong",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="管事分红金额",
                    ),
                ),
                (
                    "zuzhang_fenhong",
                    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="更新时间"),
                ),
                (
                    "huiyuan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="shangpin.huiyuan",
                        verbose_name="会员",
                    ),
                ),
            ],
            options={
                "verbose_name": "多次分红配置",
                "verbose_name_plural": "多次分红配置",
                "db_table": "duoci_fenhong",
                "indexes": [
                    models.Index(
                        fields=["guanshi"], name="duoci_fenho_guanshi_b3de53_idx"
                    ),
                    models.Index(
                        fields=["zuzhang"], name="duoci_fenho_zuzhang_69997d_idx"
                    ),
                ],
                "unique_together": {("huiyuan", "guanshi", "cishu")},
            },
        ),
    ]
