diff --git a/app/db/db_comm_coupon_user_ord.go b/app/db/db_comm_coupon_user_ord.go index a2bcfc9..bf0ea4a 100644 --- a/app/db/db_comm_coupon_user_ord.go +++ b/app/db/db_comm_coupon_user_ord.go @@ -6,6 +6,7 @@ import ( "applet/app/utils" "applet/app/utils/logx" "fmt" + "github.com/syyongx/php2go" "strings" "xorm.io/xorm" ) @@ -118,6 +119,14 @@ func CouponUserOrdByGidAscBatch(eg *xorm.Engine, uid int, gid string, refundStat } else { session = eg.Where("uid=? AND type= ? and gid=? and refund_state=?", uid, 1, gid, refundState) } + } else if utils.InArr(pvd, []string{md.PVD_JD}) && php2go.IsNumeric(gid) == false { + ex := strings.Split(gid, "_") + if len(ex) == 2 { + gid = ex[1] + session = eg.Where("uid=? AND type= ? and gid LIKE ? and refund_state=?", uid, 1, "%"+gid+"%", refundState) + } else { + session = eg.Where("uid=? AND type= ? and gid=? and refund_state=?", uid, 1, gid, refundState) + } } else { session = eg.Where("uid=? AND type= ? and gid=? and refund_state=?", uid, 1, gid, refundState) } @@ -141,6 +150,14 @@ func CouponUserOrdByGidAscBatchALL(eg *xorm.Engine, uid int, gid string, refundS } else { session = eg.Where("uid=? AND type= ? and gid=? and refund_state=? and batch=?", uid, 1, gid, refundState, batch) } + } else if utils.InArr(pvd, []string{md.PVD_JD}) && php2go.IsNumeric(gid) == false { + ex := strings.Split(gid, "_") + if len(ex) == 2 { + gid = ex[1] + session = eg.Where("uid=? AND type= ? and gid LIKE ? and refund_state=? and batch=?", uid, 1, "%"+gid+"%", refundState, batch) + } else { + session = eg.Where("uid=? AND type= ? and gid=? and refund_state=? and batch=?", uid, 1, gid, refundState, batch) + } } else { session = eg.Where("uid=? AND type= ? and gid=? and refund_state=? and batch=?", uid, 1, gid, refundState, batch) }