wuyi 3 месяцев назад
Родитель
Сommit
99c95ae547
2 измененных файлов с 7 добавлено и 10 удалено
  1. 5 5
      src/entities/income-records.entity.ts
  2. 2 5
      src/services/income-records.service.ts

+ 5 - 5
src/entities/income-records.entity.ts

@@ -17,10 +17,10 @@ export enum OrderType {
 }
 }
 
 
 @Entity()
 @Entity()
-@Index('idx_agent_date_type', ['agentId', 'createdAt', 'incomeType'])
-@Index('idx_user_date', ['userId', 'createdAt'])
-@Index('idx_agent_date_del_type', ['agentId', 'createdAt', 'delFlag', 'incomeType'])
-@Index('idx_user_date_del', ['userId', 'createdAt', 'delFlag'])
+@Index('idx_status_del_created', ['status', 'delFlag', 'createdAt'])
+@Index('idx_agent_status_del_created', ['agentId', 'status', 'delFlag', 'createdAt'])
+@Index('idx_user_status_del_created', ['userId', 'status', 'delFlag', 'createdAt'])
+@Index('idx_order_no', ['orderNo'])
 export class IncomeRecords {
 export class IncomeRecords {
   @PrimaryGeneratedColumn()
   @PrimaryGeneratedColumn()
   id: number
   id: number
@@ -62,7 +62,7 @@ export class IncomeRecords {
   })
   })
   orderPrice: number
   orderPrice: number
 
 
-  @Column()
+  @Column({ length: 50 })
   orderNo: string
   orderNo: string
 
 
   @Column()
   @Column()

+ 2 - 5
src/services/income-records.service.ts

@@ -43,7 +43,6 @@ export class IncomeRecordsService {
       payChannel,
       payChannel,
       payNo,
       payNo,
       resourceId,
       resourceId,
-      status,
       startDate,
       startDate,
       endDate,
       endDate,
       select,
       select,
@@ -84,14 +83,12 @@ export class IncomeRecordsService {
       where.resourceId = resourceId
       where.resourceId = resourceId
     }
     }
 
 
-    if (status !== undefined) {
-      where.status = status
-    }
+    where.status = true
 
 
     if (startDate && endDate) {
     if (startDate && endDate) {
       where.createdAt = Between(new Date(startDate), new Date(endDate))
       where.createdAt = Between(new Date(startDate), new Date(endDate))
     }
     }
-    
+
     if (delFlag !== undefined) {
     if (delFlag !== undefined) {
       where.delFlag = delFlag
       where.delFlag = delFlag
     }
     }