|
|
@@ -193,10 +193,14 @@ class RecentMonthPestCount(GenericAPIView):
|
|
|
result[pest] += int(num)
|
|
|
else:
|
|
|
result[pest] = int(num)
|
|
|
- imgs.append(addr if addr.startswith("http") else "https://bigdata-image.oss-cn-hangzhou.aliyuncs.com/Basics/cbd/" + addr)
|
|
|
+ imgs.append(addr if addr.startswith("http") else "https://bigdata-image.oss-cn-hangzhou.aliyuncs.com/Basics/cbd/" + addr)
|
|
|
+ temp = {}
|
|
|
+ for k, v in result.items():
|
|
|
+ if k in insect_dict.keys():
|
|
|
+ temp[insect_dict.get(k)] = v
|
|
|
data = {
|
|
|
"pest": result,
|
|
|
- "imgs": imgs
|
|
|
+ "imgs": imgs[:10]
|
|
|
}
|
|
|
return Response(data)
|
|
|
except Exception as e:
|