@ -193,11 +193,12 @@ func QueryWaitcomplete(c *gin.Context) {
var array [ ] user . Withdraw
var array [ ] user . Withdraw
dbc . DB . Limit ( 10 ) . Offset ( p . Page * 10 ) . Order ( "created_at desc" ) . Find ( & array , where , p . MinMoney , p . MaxMoney , p . ID , p . Name )
dbc . DB . Limit ( 10 ) . Offset ( p . Page * 10 ) . Order ( "created_at desc" ) . Find ( & array , where , p . MinMoney , p . MaxMoney , p . ID , p . Name )
type moneyType struct {
type moneyType struct {
Monet float32 ` gorm:"column:all_amount" `
Monet float32 ` gorm:"column:all_amount" `
ActualAmountCount decimal . Decimal ` gorm:"column:actual_amount_count" `
}
}
var moneyAll [ ] moneyType
var moneyAll moneyType
dbc . DB . Table ( ( & user . Withdraw { } ) . TableName ( ) ) . Select ( "sum(amount) as all_amount ") . Where ( where , p . MinMoney , p . MaxMoney , p . ID , p . Name ) . Scan ( & moneyAll )
dbc . DB . Table ( ( & user . Withdraw { } ) . TableName ( ) ) . Select ( "sum(amount) as all_amount , sum(actual_amount) as actual_amount_count ") . Where ( where , p . MinMoney , p . MaxMoney , p . ID , p . Name ) . Scan ( & moneyAll )
for key , _info := range array {
for key , _info := range array {
information := user . Information { }
information := user . Information { }
@ -206,14 +207,12 @@ func QueryWaitcomplete(c *gin.Context) {
array [ key ] . UserTrueNo = information . IDCard
array [ key ] . UserTrueNo = information . IDCard
array [ key ] . UserPhone = information . Mobile
array [ key ] . UserPhone = information . Mobile
}
}
money := float32 ( 0.0 )
if len ( moneyAll ) > 0 {
money = moneyAll [ 0 ] . Monet
}
back . Suc ( c , "" , gin . H {
back . Suc ( c , "" , gin . H {
"total" : count ,
"total" : count ,
"list" : array ,
"list" : array ,
"money" : money ,
"money" : moneyAll . Monet ,
"actualAmountCount" : moneyAll . ActualAmountCount ,
} )
} )
}
}
@ -308,11 +307,12 @@ func QueryComplete(c *gin.Context) {
dbc . DB . Limit ( 10 ) . Offset ( p . Page * 10 ) . Order ( "created_at desc" ) . Find ( & array , where , p . MinMoney , p . MaxMoney , p . ID , p . Name )
dbc . DB . Limit ( 10 ) . Offset ( p . Page * 10 ) . Order ( "created_at desc" ) . Find ( & array , where , p . MinMoney , p . MaxMoney , p . ID , p . Name )
type moneyType struct {
type moneyType struct {
Monet float32 ` gorm:"column:all_amount" `
Monet float32 ` gorm:"column:all_amount" `
ActualAmountCount decimal . Decimal ` gorm:"column:actual_amount_count" `
}
}
var moneyAll [ ] moneyType
var moneyAll moneyType
dbc . DB . Table ( ( & user . Withdraw { } ) . TableName ( ) ) . Select ( "sum(amount) as all_amount ") . Where ( where , p . MinMoney , p . MaxMoney , p . ID , p . Name ) . Scan ( & moneyAll )
dbc . DB . Table ( ( & user . Withdraw { } ) . TableName ( ) ) . Select ( "sum(amount) as all_amount , sum(actual_amount) as actual_amount_count ") . Where ( where , p . MinMoney , p . MaxMoney , p . ID , p . Name ) . Scan ( & moneyAll )
for key , _info := range array {
for key , _info := range array {
information := user . Information { }
information := user . Information { }
@ -321,13 +321,10 @@ func QueryComplete(c *gin.Context) {
array [ key ] . UserTrueNo = information . IDCard
array [ key ] . UserTrueNo = information . IDCard
array [ key ] . UserPhone = information . Mobile
array [ key ] . UserPhone = information . Mobile
}
}
money := float32 ( 0.0 )
if len ( moneyAll ) > 0 {
money = moneyAll [ 0 ] . Monet
}
back . Suc ( c , "" , gin . H {
back . Suc ( c , "" , gin . H {
"total" : count ,
"total" : count ,
"list" : array ,
"list" : array ,
"money" : money ,
"money" : moneyAll . Monet ,
"actualAmountCount" : moneyAll . ActualAmountCount ,
} )
} )
}
}