This commit is contained in:
@@ -509,6 +509,7 @@ export class TradeService {
|
||||
|
||||
async listPartnerOrders(partnerAccountId: bigint, page = 1, pageSize = 20) {
|
||||
const primary = await this.partnerCityService.resolvePrimaryAccount(partnerAccountId);
|
||||
const hasWarehouseAccess = await this.partnerCityService.hasManagedWarehouse(primary.id);
|
||||
const where = await this.partnerCityService.buildPartnerOrderWhere(primary.id);
|
||||
const [list, total] = await Promise.all([
|
||||
this.prisma.order.findMany({
|
||||
@@ -520,7 +521,14 @@ export class TradeService {
|
||||
}),
|
||||
this.prisma.order.count({ where }),
|
||||
]);
|
||||
return { list: serializeBigInt(list.map(mapOrderCompat)), total, page, pageSize };
|
||||
return {
|
||||
list: serializeBigInt(list.map(mapOrderCompat)),
|
||||
total,
|
||||
page,
|
||||
pageSize,
|
||||
hasWarehouseAccess,
|
||||
message: hasWarehouseAccess ? undefined : '未配置仓库管理权限,购酒订单由总部履约',
|
||||
};
|
||||
}
|
||||
|
||||
async getPartnerOrder(partnerAccountId: bigint, orderId: bigint) {
|
||||
|
||||
Reference in New Issue
Block a user