="lines-code">
+ mssi.num += 1
+ mssi.save()
@@ -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 |
|
@@ -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) |