|
@@ -93,7 +93,8 @@ class AlgorithmShopView(View):
|
|
|
.values('algorithm_type__icon_url', 'algorithm_type__id',
|
|
|
'title', 'subtitle', 'algorithm_type__image_url',
|
|
|
'algorithm_type__basic_function', 'concerning',
|
|
|
- 'price', 'algorithm_type__tag', 'algorithm_type__status')
|
|
|
+ 'price', 'algorithm_type__tag', 'algorithm_type__status',
|
|
|
+ 'algorithm_type__type')
|
|
|
if not algorithm_qs.exists():
|
|
|
return {}
|
|
|
setting = '' # 当前支持设置的算法功能json
|
|
@@ -112,7 +113,8 @@ class AlgorithmShopView(View):
|
|
|
'price': algorithm_qs[0]['price'],
|
|
|
'tag': algorithm_qs[0]['algorithm_type__tag'],
|
|
|
'status': algorithm_qs[0]['algorithm_type__status'],
|
|
|
- 'setting': setting
|
|
|
+ 'setting': setting,
|
|
|
+ 'algorithmType': algorithm_qs[0]['algorithm_type__type']
|
|
|
}
|
|
|
return data
|
|
|
except Exception as e:
|
|
@@ -129,12 +131,13 @@ class AlgorithmShopView(View):
|
|
|
algorithm_qs = DeviceAlgorithmExplain.objects.filter(lang=lang).order_by('algorithm_type__sort') \
|
|
|
.annotate(iconUrl=F('algorithm_type__icon_url'),
|
|
|
typeId=F('algorithm_type__id'),
|
|
|
+ algorithmType=F('algorithm_type__type'),
|
|
|
imageUrl=F('algorithm_type__image_url'),
|
|
|
basicFunction=F('algorithm_type__basic_function'),
|
|
|
tag=F('algorithm_type__tag'), status=F('algorithm_type__status'),
|
|
|
setting=Value('', output_field=CharField())) \
|
|
|
.values('iconUrl', 'imageUrl', 'title', 'subtitle', 'concerning', 'basicFunction', 'price', 'tag', 'status',
|
|
|
- 'setting', 'typeId')
|
|
|
+ 'setting', 'typeId', 'algorithmType')
|
|
|
if not algorithm_qs.exists():
|
|
|
return []
|
|
|
return list(algorithm_qs)
|