diff --git a/business/model/order.go b/business/model/order.go index d51a93d83..ee82703c9 100644 --- a/business/model/order.go +++ b/business/model/order.go @@ -9,8 +9,9 @@ const ( ) const ( - PayTypeWX = 1 // 微信支付 - PayTypeTL = 2 // 通联宝支付 + PayTypeWX = 1 // 微信支付 + PayTypeTL = 2 // 通联宝支付 + PayTypeTL_DiscountCard = 3 // 通联宝支付(会员折扣卡) PayStatusNo = 0 PayStatusYes = 1 diff --git a/business/model/user.go b/business/model/user.go index 91011fbbf..eedd4962f 100644 --- a/business/model/user.go +++ b/business/model/user.go @@ -194,3 +194,19 @@ func (*UserOrderSms) TableUnique() [][]string { []string{"Mobile"}, } } + +type UserMember struct { + ModelIDCULD + + UserID string `orm:"size(48);column(user_id)" json:"userID"` //内部唯一标识 + MemberType int `json:"memberType"` //会员类型, 1为折扣卡 + MemberID int `json:"memberID"` //会员类型ID,折扣卡的话代表几档 + EndAt time.Time `json:"endAt"` //会员过期时间 +} + +func (v *UserMember) TableIndex() [][]string { + return [][]string{ + []string{"UserID"}, + []string{"CreateAt"}, + } +} diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index 250a75400..54618950d 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -323,6 +323,23 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType return orderPay, err } +func Pay4User(ctx *jxcontext.Context, thingID, payType int, vendorPayType string) (orderPay *model.OrderPay, err error) { + var ( + db = dao.GetDB() + ) + switch payType { + case model.PayTypeTL_DiscountCard: + dao.QueryConfigs(db, "会员折扣卡", model.ConfigTypeDiscountCard, "") + // if orderPay, err = pay4UserByTL(ctx, thingID, vendorPayType); err == nil && orderPay != nil { + // dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName()) + // err = dao.CreateEntity(dao.GetDB(), orderPay) + // } + default: + err = fmt.Errorf("支付方式:%d当前不支持", payType) + } + return orderPay, err +} + func time2ShortTimeStr(t time.Time) string { return t.Format("15:04") } diff --git a/controllers/jx_order2.go b/controllers/jx_order2.go index 2e24eff2a..4509ea81b 100644 --- a/controllers/jx_order2.go +++ b/controllers/jx_order2.go @@ -48,6 +48,21 @@ func (c *JxOrderController) Pay4Order() { }) } +// @Title 请求支付京西商城相关用户支付项目 +// @Description 请求支付京西商城相关用户支付项目 +// @Param token header string true "认证token" +// @Param thingID formData int true "项目ID" +// @Param payType formData int true "支付类型" +// @Param vendorPayType formData string true "平台支付类型" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /Pay4User [post] +func (c *JxOrderController) Pay4User() { + c.callPay4User(func(params *tJxorderPay4UserParams) (retVal interface{}, errCode string, err error) { + return retVal, "", err + }) +} + // @Title 买家取消(或申请取消)订单 // @Description 买家取消(或申请取消)订单 // @Param token header string true "认证token"