feat: 公告按页、身份标签、拼多多订单号、派单与抢单改造

This commit is contained in:
XingQue
2026-06-25 15:35:51 +08:00
parent d1dc65e13b
commit 9575edcfc4
17 changed files with 646 additions and 15 deletions

View File

@@ -0,0 +1,34 @@
from django.db import migrations, models
def backfill_gonggao_page_key(apps, schema_editor):
Gonggao = apps.get_model('config', 'Gonggao')
for row in Gonggao.objects.filter(page_key='').only('id'):
row.page_key = 'order_pool'
row.save(update_fields=['page_key'])
for row in Gonggao.objects.filter(page_key__isnull=True).only('id'):
row.page_key = 'order_pool'
row.save(update_fields=['page_key'])
class Migration(migrations.Migration):
dependencies = [
('config', '0007_platform_income_log'),
]
operations = [
migrations.AddField(
model_name='gonggao',
name='page_key',
field=models.CharField(
db_index=True, default='order_pool', max_length=32,
verbose_name='页面标识(order_pool/accept_order/merchant_home)',
),
),
migrations.RunPython(backfill_gonggao_page_key, migrations.RunPython.noop),
migrations.AlterUniqueTogether(
name='gonggao',
unique_together={('club_id', 'page_key')},
),
]