# Generated by Django 6.0 on 2025-12-20 23:54

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="UserMain",
            fields=[
                (
                    "id",
                    models.AutoField(
                        primary_key=True, serialize=False, verbose_name="主键ID"
                    ),
                ),
                (
                    "yonghuid",
                    models.CharField(
                        db_index=True, max_length=7, unique=True, verbose_name="用户ID"
                    ),
                ),
                (
                    "openid",
                    models.CharField(
                        db_index=True,
                        max_length=64,
                        unique=True,
                        verbose_name="微信OpenID",
                    ),
                ),
                (
                    "avatar",
                    models.URLField(
                        blank=True, max_length=255, null=True, verbose_name="头像URL"
                    ),
                ),
                (
                    "phone",
                    models.CharField(
                        blank=True,
                        db_index=True,
                        max_length=11,
                        null=True,
                        verbose_name="手机号",
                    ),
                ),
                (
                    "user_type",
                    models.CharField(
                        choices=[
                            ("normal", "普通用户"),
                            ("dashou", "打手"),
                            ("shop", "商家"),
                            ("guanshi", "管事"),
                            ("admin", "管理员"),
                        ],
                        default="normal",
                        max_length=10,
                        verbose_name="用户类型",
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
                (
                    "yaoqingma",
                    models.CharField(
                        blank=True, max_length=20, null=True, verbose_name="邀请码"
                    ),
                ),
            ],
            options={
                "verbose_name": "用户主表",
                "verbose_name_plural": "用户主表",
                "db_table": "user_main",
                "indexes": [
                    models.Index(
                        fields=["yonghuid"], name="user_main_yonghui_b8b2fe_idx"
                    ),
                    models.Index(fields=["openid"], name="user_main_openid_c9edbe_idx"),
                    models.Index(fields=["phone"], name="user_main_phone_c76495_idx"),
                    models.Index(
                        fields=["user_type"], name="user_main_user_ty_8515fd_idx"
                    ),
                ],
            },
        ),
        migrations.CreateModel(
            name="UserGuanshi",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("dianhua", models.CharField(max_length=20, verbose_name="管事电话")),
                (
                    "wechat",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="管事微信号"
                    ),
                ),
                (
                    "yaogingshuliang",
                    models.IntegerField(default=0, verbose_name="邀请打手总数"),
                ),
                (
                    "zhuangtai",
                    models.IntegerField(
                        choices=[(0, "禁用"), (1, "正常")],
                        default=1,
                        verbose_name="管事状态",
                    ),
                ),
                (
                    "jinrichongzhi",
                    models.IntegerField(default=0, verbose_name="今日充值打手数量"),
                ),
                (
                    "jinyuechongzhi",
                    models.IntegerField(default=0, verbose_name="今月充值打手数量"),
                ),
                (
                    "chongzhifenrun",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="充值分佣总额",
                    ),
                ),
                (
                    "yue",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="可提现余额",
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="guanshi_profile",
                        to="yonghu.usermain",
                        verbose_name="关联用户",
                    ),
                ),
            ],
            options={
                "verbose_name": "管事扩展表",
                "verbose_name_plural": "管事扩展表",
                "db_table": "user_guanshi",
                "indexes": [
                    models.Index(fields=["user"], name="user_guansh_user_id_cbadac_idx")
                ],
            },
        ),
        migrations.CreateModel(
            name="UserDashou",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "nicheng",
                    models.CharField(
                        db_index=True,
                        max_length=50,
                        unique=True,
                        verbose_name="打手昵称",
                    ),
                ),
                (
                    "zhuangtai",
                    models.IntegerField(
                        choices=[(0, "离线"), (1, "在线"), (2, "忙碌")],
                        default=0,
                        verbose_name="打手状态",
                    ),
                ),
                ("jieshao", models.TextField(blank=True, verbose_name="打手介绍")),
                (
                    "jiedanzongliang",
                    models.IntegerField(default=0, verbose_name="接单总量"),
                ),
                (
                    "tuiguanliang",
                    models.IntegerField(default=0, verbose_name="退款订单总量"),
                ),
                (
                    "yue",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="可提现余额",
                    ),
                ),
                (
                    "zonge",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="打单赚取总额",
                    ),
                ),
                (
                    "dianhua",
                    models.CharField(
                        blank=True, max_length=20, verbose_name="打手电话"
                    ),
                ),
                (
                    "wechat",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="打手微信号"
                    ),
                ),
                (
                    "jinrijiedan",
                    models.IntegerField(default=0, verbose_name="今日接单数量"),
                ),
                (
                    "jinrishouyi",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="今日收益金额",
                    ),
                ),
                (
                    "jinyuejiedan",
                    models.IntegerField(default=0, verbose_name="今月接单数量"),
                ),
                (
                    "jinyueshouyi",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="今月收益金额",
                    ),
                ),
                ("jifen", models.IntegerField(default=100, verbose_name="打手积分")),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="dashou_profile",
                        to="yonghu.usermain",
                        verbose_name="关联用户",
                    ),
                ),
                (
                    "yaoqingren",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="yaoqing_dashou",
                        to="yonghu.usermain",
                        verbose_name="打手邀请人ID",
                    ),
                ),
            ],
            options={
                "verbose_name": "打手扩展表",
                "verbose_name_plural": "打手扩展表",
                "db_table": "user_dashou",
                "indexes": [
                    models.Index(
                        fields=["user"], name="user_dashou_user_id_cf0410_idx"
                    ),
                    models.Index(
                        fields=["zhuangtai"], name="user_dashou_zhuangt_f427c0_idx"
                    ),
                    models.Index(
                        fields=["yaoqingren"], name="user_dashou_yaoqing_dd346f_idx"
                    ),
                    models.Index(
                        fields=["nicheng"], name="user_dashou_nicheng_6025cb_idx"
                    ),
                ],
            },
        ),
        migrations.CreateModel(
            name="UserBoss",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("nickname", models.CharField(max_length=50, verbose_name="老板昵称")),
                (
                    "zonge",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="消费总额",
                    ),
                ),
                ("alldingdan", models.IntegerField(default=0, verbose_name="订单总数")),
                ("alltui", models.IntegerField(default=0, verbose_name="退款总数")),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="boss_profile",
                        to="yonghu.usermain",
                        verbose_name="关联用户",
                    ),
                ),
            ],
            options={
                "verbose_name": "老板扩展表",
                "verbose_name_plural": "老板扩展表",
                "db_table": "user_boss",
                "indexes": [
                    models.Index(fields=["user"], name="user_boss_user_id_4e81a4_idx")
                ],
            },
        ),
        migrations.CreateModel(
            name="AdminProfile",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("password", models.CharField(max_length=255, verbose_name="密码")),
                (
                    "wechat",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="管理员微信"
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="admin_profile",
                        to="yonghu.usermain",
                        verbose_name="关联用户",
                    ),
                ),
            ],
            options={
                "verbose_name": "管理员扩展表",
                "verbose_name_plural": "管理员扩展表",
                "db_table": "admin_profile",
                "indexes": [
                    models.Index(fields=["user"], name="admin_profi_user_id_7d067d_idx")
                ],
            },
        ),
        migrations.CreateModel(
            name="UserShangjia",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "nicheng",
                    models.CharField(
                        db_index=True,
                        max_length=50,
                        unique=True,
                        verbose_name="商家昵称",
                    ),
                ),
                (
                    "zhuangtai",
                    models.IntegerField(
                        choices=[(0, "待审核"), (1, "正常"), (2, "禁用")],
                        default=1,
                        verbose_name="商家状态",
                    ),
                ),
                ("dianhua", models.CharField(max_length=20, verbose_name="商家电话")),
                (
                    "wechat",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="商家微信号"
                    ),
                ),
                ("fabu", models.IntegerField(default=0, verbose_name="发布订单总数量")),
                (
                    "tuiguan",
                    models.IntegerField(default=0, verbose_name="退款订单总量"),
                ),
                (
                    "yue",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="商家余额",
                    ),
                ),
                (
                    "chengjiao",
                    models.IntegerField(default=0, verbose_name="商家成交订单总量"),
                ),
                (
                    "jinridingdan",
                    models.IntegerField(default=0, verbose_name="商家今日订单总量"),
                ),
                (
                    "jinriliushui",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="商家今日流水",
                    ),
                ),
                (
                    "jinyuedingdan",
                    models.IntegerField(default=0, verbose_name="商家今月订单总量"),
                ),
                (
                    "jinyueliushui",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="商家今月流水",
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="shop_profile",
                        to="yonghu.usermain",
                        verbose_name="关联用户",
                    ),
                ),
            ],
            options={
                "verbose_name": "商家扩展表",
                "verbose_name_plural": "商家扩展表",
                "db_table": "user_shangjia",
                "indexes": [
                    models.Index(
                        fields=["user"], name="user_shangj_user_id_823c5c_idx"
                    ),
                    models.Index(
                        fields=["nicheng"], name="user_shangj_nicheng_6967bc_idx"
                    ),
                ],
            },
        ),
    ]
