+ }
|
|
|
257
|
+
|
|
|
258
|
+
|
|
|
259
|
+@logit
|
|
|
260
|
+def v2_tj_distributor(request):
|
|
|
261
|
+ brand_id = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_ID)
|
|
|
262
|
+
|
|
|
263
|
+ year = tc.local_string(format='%Y')
|
|
|
264
|
+ month = tc.local_string(format='%Y%m')
|
|
|
265
|
+ day = tc.local_string(format='%Y%m%d')
|
|
|
266
|
+
|
|
|
267
|
+ lastyear = tc.local_string(tc.several_time_ago(years=1), format='%Y')
|
|
|
268
|
+ lastmonth = tc.local_string(tc.several_time_ago(months=1), format='%Y%m')
|
|
|
269
|
+ lastday = tc.local_string(tc.several_time_ago(days=1), format='%Y%m%d')
|
|
|
270
|
+
|
|
|
271
|
+ year_data = ymdtj(brand_id, year, lastyear)
|
|
|
272
|
+ month_data = ymdtj(brand_id, month, lastmonth)
|
|
|
273
|
+ day_data = ymdtj(brand_id, day, lastday)
|
|
|
274
|
+
|
|
|
275
|
+ return response(200, 'Get TJ Data Success', u'获取统计数据成功', data={
|
|
|
276
|
+ 'year_data': year_data,
|
|
|
277
|
+ 'month_data': month_data,
|
|
|
278
|
+ 'day_data': day_data,
|
|
|
279
|
+ })
|