23
|
23
|
# 注册用户数趋势
|
|
24
|
|
- register_trends = RegisterStatisticInfo.objects.filter(status=True).order_by('-pk')[:30]
|
|
|
24
|
+ register_trends = RegisterStatisticInfo.objects.filter(status=True).order_by('-ymd')[:30]
|
|
25
|
25
|
register_trends = [r.data for r in register_trends]
|
|
26
|
26
|
|
|
27
|
27
|
# 销量统计 & 今日销量
|
|
|
|
@@ -31,19 +31,19 @@ def tj_data(request):
|
|
31
|
31
|
sale_num = 0
|
|
32
|
32
|
|
|
33
|
33
|
# 商品销量趋势
|
|
34
|
|
- sale_trends = SaleStatisticInfo.objects.filter(status=True).order_by('-pk')[:30]
|
|
|
34
|
+ sale_trends = SaleStatisticInfo.objects.filter(status=True).order_by('-ymd')[:30]
|
|
35
|
35
|
sale_trends = [s.data for s in sale_trends]
|
|
36
|
36
|
|
|
37
|
37
|
# 型号销量统计 & 热销商品榜
|
|
38
|
|
- model_sales = ModelSaleStatisticInfo.objects.filter(ymd='0', status=True).order_by('-num')[:3]
|
|
|
38
|
+ model_sales = ModelSaleStatisticInfo.objects.filter(ymd=0, status=True).order_by('-num')[:3]
|
|
39
|
39
|
model_sales = [m.data for m in model_sales]
|
|
40
|
40
|
|
|
41
|
41
|
# 经销商销量统计 & 经销商榜
|
|
42
|
|
- distributor_sales = DistributorSaleStatisticInfo.objects.filter(ymd='0', status=True).order_by('-num')[:3]
|
|
|
42
|
+ distributor_sales = DistributorSaleStatisticInfo.objects.filter(ymd=0, status=True).order_by('-num')[:3]
|
|
43
|
43
|
distributor_sales = [d.data for d in distributor_sales]
|
|
44
|
44
|
|
|
45
|
45
|
# 各地区实时销量
|
|
46
|
|
- province_sales = ProvinceSaleStatisticInfo.objects.filter(ymd='0', status=True).order_by('position')
|
|
|
46
|
+ province_sales = ProvinceSaleStatisticInfo.objects.filter(ymd=0, status=True).order_by('position')
|
|
47
|
47
|
province_sales = [p.data for p in province_sales]
|
|
48
|
48
|
|
|
49
|
49
|
return response(200, 'Get TJ Data Success', u'获取统计数据成功', {
|