'use strict';
exports.main = async (event, context) => {
	const db = uniCloud.database();
	let res = await db.collection("standard").where(event).get();
	let data = res.data
	const map = new Map()
	for(let i = 0; i < data.length; i++){
		let key = data[i].type
		if(map.has(key)){
			data[i].images = data[i].images.split(",")
			map.get(key).list.push(data[i])
		}else{
			data[i].images = data[i].images.split(",")
			map.set(key,{type:key, list:[data[i]]})
		}
	}
	return [...map.values()]
};
