城市合伙人端的修改(后台)
This commit is contained in:
@@ -10,10 +10,28 @@ export class CatalogService {
|
||||
async listCities() {
|
||||
const cities = await this.prisma.commonCity.findMany({
|
||||
where: { status: 'ACTIVE' },
|
||||
include: { partner: { select: { companyName: true } } },
|
||||
include: {
|
||||
partnerAccounts: {
|
||||
where: { isPrimary: 1, bindingStatus: 'ACTIVE' },
|
||||
orderBy: { createdAt: 'asc' },
|
||||
select: { id: true, companyName: true, scopeType: true },
|
||||
},
|
||||
},
|
||||
orderBy: { name: 'asc' },
|
||||
});
|
||||
return serializeBigInt(cities);
|
||||
return serializeBigInt(
|
||||
cities.map((city) => ({
|
||||
...city,
|
||||
partnerBindingCount: city.partnerAccounts.length,
|
||||
partnerBindings: city.partnerAccounts.map((bp) => ({
|
||||
partnerAccountId: bp.id.toString(),
|
||||
partnerId: bp.id.toString(),
|
||||
companyName: bp.companyName,
|
||||
scopeType: bp.scopeType,
|
||||
})),
|
||||
partnerAccounts: undefined,
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
async listProducts(aromaType?: string, cityCode?: string) {
|
||||
|
||||
Reference in New Issue
Block a user