318af5cef57R240">240
+        mssi, _ = ConsumeModelSaleStatisticInfo.objects.select_for_update().get_or_create(
241
+            brand_id=mdl.brand_id,
242
+            model_name=mdl.model_uni_name,
243
+            ymd=ymd[:4],
244
+        )
245
+        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

説明なし

Kimi.Huang: af3d065b78 Sales 7 年 前
..
algorithm f38d3bf980 Caesar Alg 8 年 前
error af3d065b78 Sales 7 年 前
redis 9e580a4861 r1 7 年 前
shells cefc16fe75 cfg 7 年 前
sql f3cf68f957 Add PAI2_HOME_WX_API for request.weixin 8 年 前
__init__.py 52ce35cbfc add api uuid_init/uuid 10 年 前
admin_utils.py 9e4ac4fd3b Add admin_status for GroupUserInfo 9 年 前
disk_utils.py af2b3f483f change download.html to be generated from download.tmpl.html 10 年 前
group_photo_utils.py 0e7b5eb1af Update order_by of group session photos 9 年 前
message_utils.py 21b4a5403a add api lensman_brief_api 10 年 前
original_CGzC_10a50000c8811190.jpg 680f424408 Update water mark 9 年 前
original_CGzC_10a50000c8811190副本.jpg 4a8b4f8819 add watermark 10 年 前
paiai_96_96.png 4a8b4f8819 add watermark 10 年 前
paiai_water_mark.png 680f424408 Update water mark 9 年 前
price_utils.py 24e345a32f Add price func get_group_photo_price 9 年 前
qiniucdn.py ac03876ce1 qiniu_file_url 9 年 前
rdm_utils.py 4efb7f6f87 Statistic 8 年 前
storage_qiniu_utils.py f2fc73685d Update package django_xxx 8 年 前
storage_utils.py f2fc73685d Update package django_xxx 8 年 前
thumbnail_utils.py 5c9e21b29b add Only Once Function statistic_thumbnail_size to statistic thumbnail size 10 年 前
time_utils.py 511533855d Change oauth to use http 8 年 前
url_utils.py 135c21b40c from models_ext import BaseModelMixin, upload_file_url, upload_path 8 年 前
version_utils.py 13816e8774 Fix Bug: REQUEST 8 年 前
watermark_utils.py 5411626ebe Change watermark position 9 年 前
wx_utils.py 32a7d9ffa0 Update wx relative 9 年 前