="lines-code">
+        mssi.num += 1
246
+        mssi.save()

+ 1 - 1
statistic/models.py

@@ -187,7 +187,7 @@ class ConsumeSaleStatisticInfo(BaseModelMixin):
187 187
 class ConsumeModelSaleStatisticInfo(BaseModelMixin):
188 188
     brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
189 189
     model_id = models.CharField(_(u'model_id'), max_length=32, help_text=u'型号唯一标识', db_index=True)
190
-    model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称')
190
+    model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称', db_index=True)
191 191
     ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True)  # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部
192 192
     num = models.IntegerField(_(u'num'), default=0, help_text=u'数量')
193 193
 

+ 1 - 2
statistic/views.py

@@ -164,10 +164,9 @@ def __tj_generate(ymd=None):
164 164
 
165 165
             cmssi, created = ConsumeModelSaleStatisticInfo.objects.get_or_create(
166 166
                 brand_id=brand.brand_id,
167
-                model_id=mdl.model_id,
167
+                model_name=mdl.model_uni_name,
168 168
                 ymd=ymd,
169 169
             )
170
-            cmssi.model_name = mdl.model_name
171 170
             cmssi.save()
172 171
 
173 172
         distributors = DistributorInfo.objects.filter(brand_id=brand.brand_id, status=True)

kodo - Gogs: Go Git Service

No Description

FFIB: 9f79cd6def 后台管理系统发送订阅消息 5 years ago
..
migrations 4efb7f6f87 Statistic 8 years ago
static 2e20a894a3 pre_adaptive_cameras 6 years ago
__init__.py 4efb7f6f87 Statistic 8 years ago
admin.py 4efb7f6f87 Statistic 8 years ago
apps.py 4efb7f6f87 Statistic 8 years ago
custom_message.py 9f79cd6def 后台管理系统发送订阅消息 5 years ago
market_code.py 3bbfc60c06 :art: Support del_clerk_sale_submit_api 6 years ago
models.py 4efb7f6f87 Statistic 8 years ago
tests.py 4efb7f6f87 Statistic 8 years ago
views.py e812ec3fb2 switch gis to tencent 6 years ago