# Generated by Django 2.1.7 on 2020-06-20 08:16

from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import sales.models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('product', '0008_auto_20200608_0857'),
        ('company', '0042_cfgoptions_configs'),
        ('sales', '0003_auto_20200108_0939'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activities',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor_id', models.IntegerField(blank=True, db_index=True, null=True, verbose_name='族系')),
                ('target', models.SmallIntegerField(choices=[(1, '消费者扫码'), (2, '经销商层级')], verbose_name='活动对象')),
                ('scheme', models.SmallIntegerField(blank=True, choices=[(1, '默认'), (2, '奖池')], null=True, verbose_name='布奖方案')),
                ('distribution', models.SmallIntegerField(blank=True, choices=[(1, '邮寄'), (2, '门店兑换')], null=True, verbose_name='实物配送方式')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('name', models.CharField(max_length=100, verbose_name='活动名称')),
                ('digest', models.CharField(max_length=300, verbose_name='活动摘要说明')),
                ('priority', models.SmallIntegerField(default=0, verbose_name='活动优先级')),
                ('tm_start', models.DateTimeField(verbose_name='活动开始时间')),
                ('tm_end', models.DateTimeField(verbose_name='活动结束时间')),
                ('agents', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='指定经销商')),
                ('products', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='指定产品')),
                ('agent_lvs', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='指定营销层级')),
                ('adm_ids', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='指定扫码地域')),
                ('lblpkg_id', models.SmallIntegerField(choices=[(1, '瓶/支标'), (3, '箱标')], default=1, verbose_name='指定扫码标签类别')),
                ('status', models.SmallIntegerField(choices=[(0, '未激活'), (1, '进行中'), (2, '暂停'), (3, '已结束')], default=0, verbose_name='活动状态')),
                ('tm_closed', models.DateTimeField(blank=True, null=True, verbose_name='关闭时间')),
                ('sql_condition', models.CharField(blank=True, max_length=500, null=True, verbose_name='SQL查询条件')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activity_company', to='company.Company', verbose_name='公司名称')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activity_user', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('user_closed', models.ForeignKey(blank=True, null=True,on_delete=django.db.models.deletion.CASCADE, related_name='activity_user_close', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '营销活动',
                'verbose_name_plural': '营销活动',
            },
        ),
        migrations.CreateModel(
            name='ActivityAwardsConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rate', models.SmallIntegerField(verbose_name='中奖概率')),
                ('qty_upper', models.IntegerField(verbose_name='上限数量')),
                ('qty_input', models.IntegerField(verbose_name='投放数量')),
                ('qty_alarm', models.IntegerField(default=0, verbose_name='预警数量')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activityawards_activity', to='sales.Activities', verbose_name='营销活动')),
            ],
            options={
                'verbose_name': '营销活动奖品设置',
                'verbose_name_plural': '营销活动奖品设置',
            },
        ),
        migrations.CreateModel(
            name='ActivityRebatConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='返利金额')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activityrebatcfg_activity', to='sales.Activities', verbose_name='营销活动')),
                ('level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activityrebatcfg_lavel', to='company.Level', verbose_name='经销商层级')),
            ],
            options={
                'verbose_name': '经销商返利设置',
                'verbose_name_plural': '经销商返利设置',
            },
        ),
        migrations.CreateModel(
            name='AgentCashCollection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor_id', models.IntegerField(db_index=True, verbose_name='族系')),
                ('labelscan_id', models.IntegerField(blank=True, null=True, verbose_name='消费者扫码ID')),
                ('stk_batch_id', models.IntegerField(blank=True, null=True, verbose_name='层级扫码Batch_id')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='记帐金额')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cashcollection_activity', to='sales.Activities', verbose_name='营销活动')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cashcollection_agent', to='company.Company', verbose_name='经销商名称')),
            ],
            options={
                'verbose_name': '经销商记帐现金获取',
                'verbose_name_plural': '经销商记帐现金获取',
            },
        ),
        migrations.CreateModel(
            name='AgentCashWithdraw',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tm_checked', models.DateTimeField(blank=True, null=True, verbose_name='审核时间')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='提现金额')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='agtcashwithdraw_activity', to='sales.Activities', verbose_name='营销活动')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='agtcashwithdraw_agent', to='company.Company', verbose_name='经销商名称')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='agtcashwithdraw_user', to=settings.AUTH_USER_MODEL, verbose_name='操作人')),
            ],
            options={
                'verbose_name': '经销商记帐现金提取',
                'verbose_name_plural': '经销商记帐现金提取',
            },
        ),
        migrations.CreateModel(
            name='Award',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor_id', models.IntegerField(blank=True, db_index=True, null=True, verbose_name='族系')),
                ('name', models.CharField(max_length=50, verbose_name='奖品名称')),
                ('image', models.ImageField(blank=True, null=True, upload_to=sales.models.award_img_upload, verbose_name='奖品图片')),
                ('introduction', models.CharField(blank=True, max_length=200, null=True, verbose_name='奖品介绍')),
                ('points', models.IntegerField(blank=True, null=True, verbose_name='折合积分')),
                ('ref_price', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='参考价格')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '奖项列表',
                'verbose_name_plural': '奖项列表',
            },
        ),
        migrations.CreateModel(
            name='AwardAddition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.IntegerField(verbose_name='追加数量')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='awardaddition_activity', to='sales.Activities', verbose_name='营销活动')),
                ('award', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='awardaddition_award', to='sales.Award', verbose_name='奖品名称')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='awardaddition_user', to=settings.AUTH_USER_MODEL, verbose_name='操作人')),
            ],
            options={
                'verbose_name': '营销活动奖品追加',
                'verbose_name_plural': '营销活动奖品追加',
            },
        ),
        migrations.CreateModel(
            name='AwardCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='名称')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '奖品类型',
                'verbose_name_plural': '奖品类型',
            },
        ),
        migrations.CreateModel(
            name='CompanyFans',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='companyfans_activity', to='sales.Activities', verbose_name='活动名称')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='companyfans_company', to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '新增粉丝列表',
                'verbose_name_plural': '新增粉丝列表',
            },
        ),
        migrations.CreateModel(
            name='ConsumerAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('wx_openid', models.CharField(blank=True, db_index=True, max_length=50, null=True, verbose_name='微信OpenID')),
                ('wx_nickname', models.CharField(blank=True, db_index=True, max_length=100, null=True, verbose_name='微信昵称')),
                ('wx_profile', models.CharField(blank=True, max_length=400, null=True, verbose_name='微信头像')),
                ('wx_province', models.CharField(blank=True, max_length=50, null=True, verbose_name='微信省份')),
                ('wx_unionid', models.CharField(blank=True, max_length=50, null=True, verbose_name='微信城市')),
                ('name', models.CharField(blank=True, max_length=20, null=True, verbose_name='姓名')),
                ('gender', models.SmallIntegerField(blank=True, choices=[(1, '男'), (2, '女')], null=True, verbose_name='性别')),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='生日')),
                ('province', models.CharField(blank=True, max_length=50, null=True, verbose_name='省份')),
                ('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='城市')),
                ('phone', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='电话号码')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='详细地址')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '消费者帐号信息',
                'verbose_name_plural': '消费者帐号信息',
            },
        ),
        migrations.CreateModel(
            name='ConsumerRedeemed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checked_tm', models.DateTimeField(blank=True, null=True, verbose_name='审核时间')),
                ('waybill_number', models.CharField(blank=True, max_length=30, null=True, verbose_name='快递单号')),
                ('ref_code', models.CharField(blank=True, max_length=30, null=True, verbose_name='外部关联单号')),
                ('tm_send', models.DateTimeField(blank=True, null=True, verbose_name='发货时间')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('tm_received', models.DateTimeField(blank=True, null=True, verbose_name='收货时间')),
                ('is_closed', models.BooleanField(default=False, verbose_name='是否已完结')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('checked_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerredeem_user', to=settings.AUTH_USER_MODEL, verbose_name='审核人')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerredeem_company', to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '消费者领奖记录',
                'verbose_name_plural': '消费者领奖记录',
            },
        ),
        migrations.CreateModel(
            name='ConsumerWinner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('seeds_id', models.IntegerField(blank=True, null=True, verbose_name='布奖记录')),
                ('labelscan_id', models.IntegerField(blank=True, null=True, verbose_name='消费者扫码ID')),
                ('phone', models.CharField(blank=True, max_length=20, null=True, verbose_name='联系电话')),
                ('name', models.CharField(max_length=20, verbose_name='姓名')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('dt_redeemed', models.DateField(blank=True, null=True, verbose_name='领奖日期')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerwinner_activity', to='sales.Activities', verbose_name='活动名称')),
                ('award', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sales.Award', verbose_name='奖品名称')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerwinner_company', to='company.Company', verbose_name='公司名称')),
                ('consumer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerwinner_consumer', to='sales.ConsumerAccount', verbose_name='消费者帐号')),
            ],
            options={
                'verbose_name': '消费者中奖记录',
                'verbose_name_plural': '消费者中奖记录',
            },
        ),
        migrations.CreateModel(
            name='ExpressAgency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='公司名称')),
                ('code', models.CharField(blank=True, max_length=20, null=True, unique=True, verbose_name='代码')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '快递代理公司',
                'verbose_name_plural': '快递代理公司',
            },
        ),
        migrations.CreateModel(
            name='IntegralCollection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor_id', models.IntegerField(db_index=True, verbose_name='族系')),
                ('labelscan_id', models.IntegerField(blank=True, null=True, verbose_name='消费者扫码ID')),
                ('stk_batch_id', models.IntegerField(blank=True, null=True, verbose_name='层级扫码Batch_id')),
                ('points', models.IntegerField(verbose_name='获得积分')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pointcollection_activity', to='sales.Activities', verbose_name='营销活动')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pointcollection_agent', to='company.Company', verbose_name='经销商名称')),
            ],
            options={
                'verbose_name': '经销商积分获取',
                'verbose_name_plural': '经销商积分获取',
            },
        ),
        migrations.CreateModel(
            name='IntegralRedeemed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('points', models.IntegerField(verbose_name='消耗积分')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='agtpointsredeem_activity', to='sales.Activities', verbose_name='营销活动')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='agtpointsredeem_agent', to='company.Company', verbose_name='经销商名称')),
                ('award', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='integralredeemed_award', to='sales.Award', verbose_name='奖项')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='integralredeemed_user', to=settings.AUTH_USER_MODEL, verbose_name='操作人')),
            ],
            options={
                'verbose_name': '经销商积分兑换',
                'verbose_name_plural': '经销商积分兑换',
            },
        ),
        migrations.CreateModel(
            name='LabelScan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_pkg', models.SmallIntegerField(blank=True, db_index=True, null=True, verbose_name='标签类型')),
                ('label_id', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='标签ID')),
                ('label_pk_id', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='主箱标ID')),
                ('province', models.CharField(blank=True, max_length=100, null=True, verbose_name='省份')),
                ('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='城市')),
                ('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='详细地址')),
                ('pos_permission', models.BooleanField(verbose_name='是否允许获取地理位置')),
                ('lng_lat', django.contrib.postgres.fields.ArrayField(base_field=models.DecimalField(blank=True, decimal_places=8, max_digits=12), size=None)),
                ('amd_id1', models.IntegerField(blank=True, null=True, verbose_name='GIS adm_id1')),
                ('amd_id2', models.IntegerField(blank=True, null=True, verbose_name='GIS adm_id2')),
                ('amd_id3', models.IntegerField(blank=True, null=True, verbose_name='GIS adm_id3')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='labelscan_activity', to='sales.Activities', verbose_name='活动名称')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labelscan_company', to='company.Company', verbose_name='公司名称')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labelscan_consumer', to='sales.ConsumerAccount', verbose_name='消费者帐号')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='customerscan_product', to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '消费者扫码记录',
                'verbose_name_plural': '消费者扫码记录',
            },
        ),
        migrations.CreateModel(
            name='LotterySeeds',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_pkg', models.SmallIntegerField(blank=True, db_index=True, null=True, verbose_name='标签类型')),
                ('label_id', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='标签ID')),
                ('label_pk_id', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='标签PKID')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lotteryseeds_activity', to='sales.Activities', verbose_name='活动名称')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lotteryseeds_company', to='company.Company', verbose_name='公司名称')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='lotteryseeds_product', to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '标签布奖记录',
                'verbose_name_plural': '标签布奖记录',
            },
        ),
        migrations.CreateModel(
            name='LoyaltyCollection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('labelscan_id', models.IntegerField(blank=True, null=True, verbose_name='消费者扫码ID')),
                ('points', models.IntegerField(verbose_name='获得积分')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='loyaltyCollection_activity', to='sales.Activities', verbose_name='营销活动')),
                ('consumer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='loyaltycollection_consumer', to='sales.ConsumerAccount', verbose_name='消费者帐号')),
            ],
            options={
                'verbose_name': '消费者积分获取',
                'verbose_name_plural': '消费者积分获取',
            },
        ),
        migrations.CreateModel(
            name='LoyaltyRedeemed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('points', models.IntegerField(verbose_name='消耗积分')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='loyaltyredeem_activity', to='sales.Activities', verbose_name='营销活动')),
                ('award', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='loyaltyredeem_award', to='sales.Award', verbose_name='奖项')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='loyaltyredeem_consumer', to='sales.ConsumerAccount', verbose_name='消费者帐号')),
            ],
            options={
                'verbose_name': '消费者积分兑换',
                'verbose_name_plural': '消费者积分兑换',
            },
        ),
        migrations.CreateModel(
            name='WxOfficialAccounts',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='公众号名称')),
                ('wx_appid', models.CharField(max_length=100, unique=True, verbose_name='APPID')),
                ('wx_appsecret', models.CharField(max_length=100, unique=True, verbose_name='APPSECRET')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '微信公众号',
                'verbose_name_plural': '微信公众号',
            },
        ),
        migrations.AddField(
            model_name='consumerredeemed',
            name='expressagency',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerredeem_expressagency', to='sales.ExpressAgency', verbose_name='快递代理公司'),
        ),
        migrations.AddField(
            model_name='consumerredeemed',
            name='winner',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='cunsumerredeem_awardwinner', to='sales.ConsumerWinner', verbose_name='中奖记录'),
        ),
        migrations.AddField(
            model_name='consumeraccount',
            name='wx_account',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sales.WxOfficialAccounts', verbose_name='微信公众号'),
        ),
        migrations.AddField(
            model_name='companyfans',
            name='consumer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='companyfans_consumer', to='sales.ConsumerAccount', verbose_name='消费者帐号'),
        ),
        migrations.AddField(
            model_name='award',
            name='awardcat',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='award_cat', to='sales.AwardCategory', verbose_name='奖品类型'),
        ),
        migrations.AddField(
            model_name='award',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='award_company', to='company.Company', verbose_name='公司名称'),
        ),
        migrations.AddField(
            model_name='activityawardsconfig',
            name='award',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activityawards_award', to='sales.Award', verbose_name='奖品名称'),
        ),
        migrations.AddField(
            model_name='activities',
            name='wx_account',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activity_wxaccout', to='sales.WxOfficialAccounts', verbose_name='微信公众号'),
        ),
        migrations.AlterUniqueTogether(
            name='companyfans',
            unique_together={('company', 'consumer')},
        ),
        migrations.AlterUniqueTogether(
            name='award',
            unique_together={('company', 'name')},
        ),
    ]
