You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
788 B
27 lines
788 B
package service
|
|
|
|
import (
|
|
"pure/global"
|
|
"pure/model"
|
|
"pure/model/request"
|
|
)
|
|
|
|
func GetWithdrawal(userId string, info *request.FlowNoParam) (error, model.Withdrawal) {
|
|
var (
|
|
err error
|
|
result model.Withdrawal
|
|
)
|
|
err = global.MG_DB.Model(&model.Withdrawal{}).Where("platform = '1' AND create_by = ? AND flow_no = ?", userId, info.FlowNo).First(&result).Error
|
|
return err, result
|
|
}
|
|
func GetWithdrawalList(userId string, info *request.PageInfo) (error, []model.Withdrawal) {
|
|
var (
|
|
err error
|
|
result []model.Withdrawal
|
|
)
|
|
limit := info.PageSize
|
|
offset := info.PageSize * (info.Page - 1)
|
|
err = global.MG_DB.Model(&model.Withdrawal{}).Where("platform = '1' AND create_by = ?", userId).
|
|
Order("id DESC").Offset(offset).Limit(limit).Find(&result).Error
|
|
return err, result
|
|
}
|
|
|