新增 merchant_order_action_log,在结算/撤单/退款/罚单/派单/换打手成功路径写入真实操作人;提供 action-stats / action-operators 接口供经营数据页筛选统计。 Co-authored-by: Cursor <cursoragent@cursor.com>
47 lines
2.4 KiB
Python
47 lines
2.4 KiB
Python
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('merchant_ops', '0002_merchantstaffmember_merchant_remark'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='MerchantOrderActionLog',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('club_id', models.CharField(db_index=True, default='xq', max_length=16)),
|
|
('merchant_id', models.CharField(db_index=True, max_length=7)),
|
|
('order_id', models.CharField(db_index=True, max_length=32)),
|
|
('action_code', models.PositiveSmallIntegerField(db_index=True, verbose_name='行为码')),
|
|
('operator_user_id', models.CharField(db_index=True, max_length=7)),
|
|
('operator_type', models.CharField(max_length=16, verbose_name='MERCHANT/STAFF')),
|
|
('staff_member_id', models.BigIntegerField(blank=True, db_index=True, null=True)),
|
|
('role_code', models.CharField(blank=True, default='', max_length=32)),
|
|
('role_name', models.CharField(blank=True, default='', max_length=64)),
|
|
('amount', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
|
|
('leixing_id', models.IntegerField(blank=True, db_index=True, null=True)),
|
|
('remark', models.CharField(blank=True, default='', max_length=500)),
|
|
('CreateTime', models.DateTimeField(auto_now_add=True, db_index=True)),
|
|
],
|
|
options={
|
|
'verbose_name': '商家订单操作流水',
|
|
'db_table': 'merchant_order_action_log',
|
|
},
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='merchantorderactionlog',
|
|
index=models.Index(fields=['merchant_id', 'operator_user_id', '-CreateTime'], name='merchant_or_merchan_op_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='merchantorderactionlog',
|
|
index=models.Index(fields=['merchant_id', 'action_code', '-CreateTime'], name='merchant_or_merchan_ac_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='merchantorderactionlog',
|
|
index=models.Index(fields=['merchant_id', 'leixing_id', '-CreateTime'], name='merchant_or_merchan_lx_idx'),
|
|
),
|
|
]
|