diff --git a/src/controller/order.controller.ts b/src/controller/order.controller.ts index aa71e46..79f1a61 100644 --- a/src/controller/order.controller.ts +++ b/src/controller/order.controller.ts @@ -97,6 +97,16 @@ export class OrderController { } } + @ApiOkResponse() + @Get('/getOrderItems') + async getOrderItems(@Query() param: QueryOrderSalesDTO) { + try { + return successResponse(await this.orderService.getOrderItems(param)); + } catch (error) { + return errorResponse(error?.message || '获取失败'); + } + } + @ApiOkResponse({ type: OrderDetailRes, }) diff --git a/src/entity/order_item.entity.ts b/src/entity/order_item.entity.ts index d41eef2..0a3fd5b 100644 --- a/src/entity/order_item.entity.ts +++ b/src/entity/order_item.entity.ts @@ -76,16 +76,61 @@ export class OrderItem { @Expose() total_tax: number; + @ApiProperty() + @Column({ nullable: true }) + @Expose() + tax_class?: string; // 税类(来自 line_items.tax_class) + + @ApiProperty() + @Column({ type: 'json', nullable: true }) + @Expose() + taxes?: any[]; // 税明细(来自 line_items.taxes,数组) + + @ApiProperty() + @Column({ type: 'json', nullable: true }) + @Expose() + meta_data?: any[]; // 行项目元数据(包含订阅相关键值) + @ApiProperty() @Column({ nullable: true }) @Expose() sku?: string; + @ApiProperty() + @Column({ nullable: true }) + @Expose() + global_unique_id?: string; // 全局唯一ID(部分主题/插件会提供) + @ApiProperty() @Column('decimal', { precision: 10, scale: 2 }) @Expose() price: number; + @ApiProperty() + @Column({ type: 'json', nullable: true }) + @Expose() + image?: { id?: string | number; src?: string }; // 商品图片(对象,包含 id/src) + + @ApiProperty() + @Column({ nullable: true }) + @Expose() + parent_name?: string; // 父商品名称(组合/捆绑时可能使用) + + @ApiProperty() + @Column({ nullable: true }) + @Expose() + bundled_by?: string; // 捆绑来源标识(bundled_by) + + @ApiProperty() + @Column({ nullable: true }) + @Expose() + bundled_item_title?: string; // 捆绑项标题 + + @ApiProperty() + @Column({ type: 'json', nullable: true }) + @Expose() + bundled_items?: any[]; // 捆绑项列表(数组) + @ApiProperty({ example: '2022-12-12 11:11:11', description: '创建时间',