cash limit

This commit is contained in:
苏尹岚
2020-10-20 14:19:18 +08:00
parent 150ec0701c
commit d20d77c8ec
5 changed files with 55 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
package cms
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/jxstore/financial"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -82,6 +84,14 @@ func Cash(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (e
if userBill.AccountBalance < order.PayPrice {
return model.ErrCodeAccountBalanceNotEnough, err
}
//用户一天只能提现一次
billExpends, err := dao.GetBillExpend(db, order.UserID, model.BillTypeCash, DayTimeBegin, DayTimeEnd)
if err != nil {
return errCode, err
}
if len(billExpends) > 0 {
return errCode, fmt.Errorf("抱歉,一天只能提现一次!")
}
err = payHandler.CreateRefund()
return errCode, err
}