@@ -75,7 +75,7 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
7575 }
7676
7777 async mGetByIds ( ids : string [ ] , pick = this . pick , trx ?: CoaMysql . Transaction , ms = this . ms , force = false ) {
78- const result = await this . redisCache . mWarp ( this . getCacheNsp ( 'id' ) , ids , async ( ids ) => await super . mGetByIds ( ids , this . columns , trx ) , ms , force )
78+ const result = await this . redisCache . mWarp ( this . getCacheNsp ( 'id' ) , ids , async ids => await super . mGetByIds ( ids , this . columns , trx ) , ms , force )
7979 _ . forEach ( result , ( v , k ) => {
8080 result [ k ] = this . pickResult ( v , pick )
8181 } )
@@ -114,7 +114,7 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
114114
115115 protected async mGetCountBy ( field : string , ids : string [ ] , trx ?: CoaMysql . Transaction ) {
116116 const cacheNsp = this . getCacheNsp ( 'count' , field )
117- return await this . redisCache . mWarp ( cacheNsp , ids , async ( ids ) => {
117+ return await this . redisCache . mWarp ( cacheNsp , ids , async ids => {
118118 const rows = ( await this . table ( trx ) . select ( { id : field } ) . count ( { count : this . key } ) . whereIn ( field , ids ) . groupBy ( field ) ) as any [ ]
119119 const result : CoaMysql . Dic < number > = { }
120120 _ . forEach ( rows , ( { id, count } ) => ( result [ id ] = count ) )
@@ -145,7 +145,7 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
145145 let has = true
146146 const resultList = [ ] as Array < CoaMysql . SafePartial < Scheme > >
147147 if ( data ) {
148- has = _ . some ( this . cachesFields , ( i ) => ( data as any ) [ i ] !== undefined )
148+ has = _ . some ( this . cachesFields , i => ( data as any ) [ i ] !== undefined )
149149 resultList . push ( data )
150150 }
151151 if ( has ) {
@@ -161,7 +161,7 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
161161 deleteIds . push ( [ this . getCacheNsp ( 'data' ) , [ ] ] )
162162 _ . forEach ( this . caches , ( items , name ) => {
163163 // name可能为index,count,或自定义
164- items . forEach ( ( item ) => {
164+ items . forEach ( item => {
165165 const keys = item . split ( / [: ,] / )
166166 const key = keys [ 0 ]
167167 const ids = [ ] as string [ ]
0 commit comments