|
@@ -0,0 +1,37 @@
|
|
|
+import { CoolController, BaseController } from '@cool-midway/core';
|
|
|
+import { ALL, Body, Get, Inject, Post, Provide, Query } from '@midwayjs/decorator';
|
|
|
+import { OpenPaymentOrderEntity } from '../entity/open_payment_order';
|
|
|
+import { InjectEntityModel } from '@midwayjs/typeorm';
|
|
|
+import { Equal, Repository } from 'typeorm';
|
|
|
+import { OrderType } from '../entity/open_payment_order'
|
|
|
+
|
|
|
+/**
|
|
|
+ * 交易列表
|
|
|
+ */
|
|
|
+@Provide()
|
|
|
+@CoolController('/api/transaction')
|
|
|
+export class TransactionController extends BaseController {
|
|
|
+ @InjectEntityModel(OpenPaymentOrderEntity)
|
|
|
+ transactionEntity: Repository<OpenPaymentOrderEntity>;
|
|
|
+ /**
|
|
|
+ * 获取交易列表
|
|
|
+ * /api/transaction/page
|
|
|
+ */
|
|
|
+ @Get('/page', { summary: '获取交易列表' })
|
|
|
+ async getTransactionPage(
|
|
|
+ @Query('mch_id') mch_id: string,
|
|
|
+ @Query('order_type') order_type: string,
|
|
|
+ @Query('status') status: string,
|
|
|
+ @Query('keyWord') keyWord: string,) {
|
|
|
+ console.log('获取交易列表-=-=-=-=999')
|
|
|
+ const result = this.transactionEntity.find({
|
|
|
+ where: {
|
|
|
+ status: status,
|
|
|
+ mch_id: mch_id,
|
|
|
+ order_type: OrderType[order_type],
|
|
|
+ // keyWord: keyWord,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return result
|
|
|
+ }
|
|
|
+}
|