:art: user_from

huangqimin001 5 年之前
父节点
当前提交
fcf9b28df2
共有 3 个文件被更改,包括 22 次插入2 次删除
  1. 1 1
      account/admin.py
  2. 20 0
      account/migrations/0047_auto_20200601_0242.py
  3. 1 1
      account/models.py

+ 1 - 1
account/admin.py

@@ -9,7 +9,7 @@ from mch.models import ConsumeInfoSubmitLogInfo
9 9
 
10 10
 class UserInfoAdmin(ChangeOnlyModelAdmin, admin.ModelAdmin):
11 11
     list_display = ('user_id', 'nickname', 'phone', 'appid', 'unionid', 'openid', 'openid_miniapp', 'location', 'balance', 'integral', 'freeze_integral', 'user_status', 'test_user', 'status', 'created_at', 'updated_at')
12
-    list_filter = ('appid', 'subscribe', 'has_membercard', 'test_user', 'sex', 'user_status', 'status', 'code_version', 'new_subscribe', 'created_at', 'integral')
12
+    list_filter = ('user_from', 'appid', 'subscribe', 'has_membercard', 'test_user', 'sex', 'user_status', 'status', 'code_version', 'new_subscribe', 'created_at', 'integral')
13 13
     readonly_fields = ('user_id', )
14 14
     search_fields = ('user_id', 'username', 'unionid', 'openid', 'openid_miniapp', 'name', 'phone', 'location')
15 15
 

+ 20 - 0
account/migrations/0047_auto_20200601_0242.py

@@ -0,0 +1,20 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.29 on 2020-05-31 18:42
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('account', '0046_auto_20200601_0237'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.AlterField(
16
+            model_name='userinfo',
17
+            name='user_from',
18
+            field=models.IntegerField(choices=[(0, 'APP \u521b\u5efa\u7528\u6237'), (1, '\u5fae\u4fe1\u6388\u6743\u7528\u6237'), (8, '\u7528\u6237\u7aef\u7528\u6237'), (9, '\u6e38\u5ba2\u7528\u6237'), (10, '\u6444\u5f71\u5e08\u7aef\u7528\u6237'), (11, '\u5bfc\u6e38\u7aef\u7528\u6237'), (12, '\u5c0f\u7a0b\u5e8f\u7aef\u7528\u6237'), (22, '\u4f01\u4e1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7aef\u7528\u6237'), (13, '\u7f51\u9875\u6388\u6743\u7528\u6237')], db_index=True, default=0, help_text='\u7528\u6237\u6765\u6e90', verbose_name='user_from'),
19
+        ),
20
+    ]

+ 1 - 1
account/models.py

@@ -311,7 +311,7 @@ class UserInfo(BaseModelMixin, LensmanTypeBoolMixin):
311 311
 
312 312
     user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True, unique=True)
313 313
 
314
-    user_from = models.IntegerField(_(u'user_from'), choices=USER_FROM, default=APP_USER, help_text=u'用户来源')
314
+    user_from = models.IntegerField(_(u'user_from'), choices=USER_FROM, default=APP_USER, help_text=u'用户来源', db_index=True)
315 315
     uuid = models.CharField(_(u'uuid'), max_length=255, blank=True, null=True, help_text=u'通用唯一识别码 (Universally Unique Identifier)', db_index=True)
316 316
     # APP 创建用户
317 317
     username = models.CharField(_(u'username'), max_length=255, blank=True, null=True, help_text=u'用户用户名', db_index=True, unique=True)