ymd

Brightcells vor 5 Jahren
Ursprung
Commit
3ae0f11c59
1 geänderte Dateien mit 4 neuen Zeilen und 2 gelöschten Zeilen
  1. 4 2
      page/sale_views.py

+ 4 - 2
page/sale_views.py

@@ -84,6 +84,8 @@ def clerk_sale_submit_api(request):
84 84
     except ValueError:
85 85
         return response(ProductDistributorStatusCode.DISTRIBUTOR_NOT_FOUND)
86 86
 
87
+    ymd = tc.local_string(format='%Y%m%d')
88
+
87 89
     # 店员提交记录
88 90
     ssli = SaleclerkSubmitLogInfo.objects.create(
89 91
         brand_pk=brand.pk,
@@ -102,6 +104,8 @@ def clerk_sale_submit_api(request):
102 104
         image=file_path,
103 105
         test_user=clerk.test_user,
104 106
         test_sn=test_sn,
107
+        ym=ymd[:6],
108
+        ymd=ymd,
105 109
     )
106 110
 
107 111
     if test_sn:
@@ -166,8 +170,6 @@ def clerk_sale_submit_api(request):
166 170
 
167 171
     # TODO: Make statistic async
168 172
     if not clerk.test_user and not sci:
169
-        ymd = tc.local_string(format='%Y%m%d')
170
-
171 173
         # 日销量统计
172 174
         ssi, _ = SaleStatisticInfo.objects.select_for_update().get_or_create(
173 175
             brand_id=brand.brand_id,