+ )
+ yesterday_num = sums.get('yesterday_num__sum', 0) or 0
+ current_month = sums.get('current_month__sum', 0) or 0
+ last_month = sums.get('last_month__sum', 0) or 0
+ SuperSalesResponsibilityInfoModelsSaleStatisticInfo.objects.create(
+ brand_id=b.brand_id,
+ sr_id=s.sr_id,
+ sr_name=s.name,
+ ymd=day,
+ yesterday_num=yesterday_num,
+ current_month=current_month,
+ last_month=last_month,
+ )
+
+ close_old_connections()
@@ -99,6 +99,9 @@ class SaleclerkSubmitLogInfo(BaseModelMixin): |
||
| 99 | 99 |
test_user = models.BooleanField(_(u'test_user'), default=False, help_text=_(u'是否为测试用户'), db_index=True) |
| 100 | 100 |
test_sn = models.BooleanField(_(u'test_sn'), default=False, help_text=_(u'是否为测试序列号'), db_index=True) |
| 101 | 101 |
|
| 102 |
+ ym = models.IntegerField(_(u'ym'), default=0, help_text=u'年月', db_index=True) # 例:201712, tc.local_string(format='%Y%m') |
|
| 103 |
+ ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d') |
|
| 104 |
+ |
|
| 102 | 105 |
class Meta: |
| 103 | 106 |
verbose_name = _(u'saleclerksubmitloginfo') |
| 104 | 107 |
verbose_name_plural = _(u'saleclerksubmitloginfo') |
@@ -2,8 +2,7 @@ CodeConvert==2.0.5 |
||
| 2 | 2 |
MySQL-python==1.2.5 |
| 3 | 3 |
Pillow==5.0.0 |
| 4 | 4 |
StatusCode==1.0.0 |
| 5 |
-TimeConvert==1.4.4 |
|
| 6 |
-cryptography==1.5.2 |
|
| 5 |
+TimeConvert==1.5.0 |
|
| 7 | 6 |
furl==2.0.0 |
| 8 | 7 |
isoweek==1.3.3 |
| 9 | 8 |
jsonfield==2.0.2 |
@@ -80,6 +80,9 @@ class SalesResponsibilityInfo(BaseModelMixin): |
||
| 80 | 80 |
class SalesResponsibilityInfoModelsSaleStatisticInfo(BaseModelMixin): |
| 81 | 81 |
brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) |
| 82 | 82 |
|
| 83 |
+ # 销售担当,供 SuperSalesResponsibilityInfoModelsSaleStatisticInfo 统计使用 |
|
| 84 |
+ sr_id = models.CharField(_(u'sr_id'), max_length=32, help_text=u'销售担当唯一标识', db_index=True) |
|
| 85 |
+ |
|
| 83 | 86 |
# 经销商 |
| 84 | 87 |
distributor_id = models.CharField(_(u'distributor_id'), max_length=32, help_text=u'经销商唯一标识', db_index=True) |
| 85 | 88 |
distributor_name = models.CharField(_(u'distributor_name'), max_length=255, blank=True, null=True, help_text=u'经销商名称') |