|
@@ -31,7 +31,7 @@ class VseesManagement(View):
|
|
|
response = ResponseObject()
|
|
|
if operation == 'get-device-info': # 查询微瞳设备类型图标信息
|
|
|
return self.get_device_info(response)
|
|
|
- if operation == 'get-product-info': # 获取产品信息
|
|
|
+ elif operation == 'get-product-info': # 获取产品信息
|
|
|
return self.get_product_info(request_dict, request)
|
|
|
else:
|
|
|
tko = TokenObject(
|
|
@@ -43,13 +43,13 @@ class VseesManagement(View):
|
|
|
user_id = tko.userID
|
|
|
if operation == 'get-info': # 获取信息
|
|
|
return self.get_info(request_dict, response)
|
|
|
- if operation == 'add-info': # 新增信息
|
|
|
+ elif operation == 'add-info': # 新增信息
|
|
|
return self.add_info(request_dict, request, response)
|
|
|
- if operation == 'edit-status': # 修改状态
|
|
|
+ elif operation == 'edit-status': # 修改状态
|
|
|
return self.edit_status(request_dict, response)
|
|
|
- if operation == 'upload-file': # 更新文件
|
|
|
+ elif operation == 'upload-file': # 更新文件
|
|
|
return self.upload_file(request_dict, request, response)
|
|
|
- if operation == 'edit-info': # 修改信息
|
|
|
+ elif operation == 'edit-info': # 修改信息
|
|
|
return self.edit_info(request_dict, response)
|
|
|
else:
|
|
|
return response.json(404)
|
|
@@ -238,7 +238,7 @@ class VseesManagement(View):
|
|
|
获取微瞳图标信息
|
|
|
"""
|
|
|
try:
|
|
|
- device_type_qs = VseesDeviceType.objects.all().values()
|
|
|
+ device_type_qs = VseesDeviceType.objects.all().values().order_by('id')
|
|
|
return response.json(0, list(device_type_qs))
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
@@ -261,11 +261,12 @@ class VseesManagement(View):
|
|
|
try:
|
|
|
product_info_qs = vseesProductInfo.objects.all()
|
|
|
if not title and product_type:
|
|
|
- product_info_qs = product_info_qs.filter(vsees__id=vsees_id, status=1).values('title')
|
|
|
+ product_info_qs = product_info_qs.filter(vsees__id=vsees_id, status=1).values('title').order_by(
|
|
|
+ '-add_time')
|
|
|
return response.json(0, list(product_info_qs))
|
|
|
else:
|
|
|
product_info_qs = product_info_qs.filter(vsees__id=vsees_id, title=title, type=product_type,
|
|
|
- status=1).values('url')
|
|
|
+ status=1).values('url').order_by('-add_time')
|
|
|
if not product_info_qs.exists():
|
|
|
return response.json(173)
|
|
|
return response.json(0, {'url': product_info_qs[0]['url']})
|