@@ -48,6 +48,6 @@ urlpatterns += [ |
||
48 | 48 |
|
49 | 49 |
# 超级销售担当 |
50 | 50 |
urlpatterns += [ |
51 |
- url(r'^supersr$', supersr_views.supersr_oauthqr, name='supersr_oauthqr'), # 授权二维码 |
|
51 |
+ url(r'^supersr/qr$', supersr_views.supersr_oauthqr, name='supersr_oauthqr'), # 授权二维码 |
|
52 | 52 |
url(r'^supersr/oauth$', supersr_views.supersr_oauth, name='supersr_oauth'), # 授权成功 |
53 | 53 |
] |
@@ -1,6 +1,23 @@ |
||
1 | 1 |
# -*- coding: utf-8 -*- |
2 |
-from __future__ import unicode_literals |
|
3 | 2 |
|
4 | 3 |
from django.contrib import admin |
5 | 4 |
|
6 |
-# Register your models here. |
|
5 |
+from sales.models import SalesResponsibilityInfo, SalesResponsibilityInfoModelsSaleStatisticInfo, SuperSalesResponsibilityInfoModelsSaleStatisticInfo |
|
6 |
+ |
|
7 |
+ |
|
8 |
+class SalesResponsibilityInfoAdmin(admin.ModelAdmin): |
|
9 |
+ list_display = ('brand_id', 'brand_name', 'sr_id', 'user_id', 'name', 'phone', 'user_status', 'is_auth', 'is_super', 'status', 'created_at', 'updated_at') |
|
10 |
+ list_filter = ('brand_id', 'user_status', 'is_auth', 'is_super', 'status') |
|
11 |
+ |
|
12 |
+ |
|
13 |
+class SalesResponsibilityInfoModelsSaleStatisticInfoAdmin(admin.ModelAdmin): |
|
14 |
+ list_filter = ('brand_id', 'distributor_id', 'distributor_name', 'model_id', 'model_name', 'is_important', 'ymd', 'today_num', 'yesterday_num', 'current_month', 'last_month', 'position', 'status', 'created_at', 'updated_at') |
|
15 |
+ |
|
16 |
+ |
|
17 |
+class SuperSalesResponsibilityInfoModelsSaleStatisticInfoAdmin(admin.ModelAdmin): |
|
18 |
+ list_filter = ('brand_id', 'sr_id', 'sr_name', 'ymd', 'today_num', 'yesterday_num', 'current_month', 'last_month', 'position', 'status', 'created_at', 'updated_at') |
|
19 |
+ |
|
20 |
+ |
|
21 |
+admin.site.register(SalesResponsibilityInfo, SalesResponsibilityInfoAdmin) |
|
22 |
+admin.site.register(SalesResponsibilityInfoModelsSaleStatisticInfo, SalesResponsibilityInfoModelsSaleStatisticInfoAdmin) |
|
23 |
+admin.site.register(SuperSalesResponsibilityInfoModelsSaleStatisticInfo, SuperSalesResponsibilityInfoModelsSaleStatisticInfoAdmin) |
@@ -29,9 +29,6 @@ class SalesResponsibilityInfo(BaseModelMixin): |
||
29 | 29 |
sr_id = ShortUUIDField(_(u'sr_id'), max_length=32, blank=True, null=True, help_text=u'销售担当唯一标识', db_index=True, unique=True) |
30 | 30 |
|
31 | 31 |
user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True) |
32 |
- unionid = models.CharField(_(u'unionid'), max_length=32, blank=True, null=True, help_text=u'微信 UnionID', db_index=True) |
|
33 |
- openid = models.CharField(_(u'openid'), max_length=32, blank=True, null=True, help_text=u'微信 OpenID', db_index=True) |
|
34 |
- |
|
35 | 32 |
name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'销售担当姓名') |
36 | 33 |
phone = models.CharField(_(u'phone'), max_length=11, blank=True, null=True, help_text=u'销售担当联系电话') |
37 | 34 |
|
@@ -16,18 +16,15 @@ from utils.error.errno_utils import SalesResponsibilityStatusCode |
||
16 | 16 |
def sr_submit_api(request): |
17 | 17 |
brand_id = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_ID) |
18 | 18 |
user_id = request.POST.get('user_id', '') |
19 |
- unionid = request.POST.get('unionid', '') |
|
20 |
- openid = request.POST.get('openid', '') |
|
19 |
+ name = request.POST.get('name', '') |
|
21 | 20 |
phone = request.POST.get('phone', '') |
22 | 21 |
|
23 | 22 |
if SalesResponsibilityInfo.objects.filter(brand_id=brand_id, phone=phone).exclude(user_id=user_id).exists(): |
24 | 23 |
return response(SalesResponsibilityStatusCode.SR_PHONE_ALREADY_EXISTS) |
25 | 24 |
|
26 | 25 |
SalesResponsibilityInfo.objects.update_or_create(brand_id=brand_id, user_id=user_id, defaults={ |
27 |
- 'name': request.POST.get('name', ''), |
|
28 |
- 'phone': request.POST.get('phone', ''), |
|
29 |
- 'unionid': unionid, |
|
30 |
- 'openid': openid, |
|
26 |
+ 'name': name, |
|
27 |
+ 'phone': phone, |
|
31 | 28 |
'user_status': SalesResponsibilityInfo.UNVERIFIED, |
32 | 29 |
'status': True, |
33 | 30 |
}) |