1、新建商城订单时判断收款账户(明慧/迪为);
This commit is contained in:
parent
98e2fa8b31
commit
85439ff6f2
|
@ -157,7 +157,8 @@ type MallOrderCreateReq struct {
|
||||||
// @Tags 商城, V1.4.5
|
// @Tags 商城, V1.4.5
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {object} model.HomeCategoryListResp
|
// @Param request body MallOrderCreateReq true "新建商城订单模型"
|
||||||
|
// @Success 200 {object} RespRet
|
||||||
// @Router /api/v1/mall/order/create [post]
|
// @Router /api/v1/mall/order/create [post]
|
||||||
func MallOrderCreate(c *gin.Context) {
|
func MallOrderCreate(c *gin.Context) {
|
||||||
req := MallOrderCreateReq{}
|
req := MallOrderCreateReq{}
|
||||||
|
@ -449,6 +450,22 @@ func MallOrderCreate(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if goods.GoodsAccountNum == model.AccountForDw { // 迪为账户收费
|
||||||
|
webPay, err := wxpay.WebPay(order.SerialNo, order.Rm, user.WxOpenID, "N", wxpay.WxPayBuyGoods, configInfo.NotifyUrl, true)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(errors.New("WebPay err"))
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ret := map[string]interface{}{
|
||||||
|
"web_pay": webPay,
|
||||||
|
"order_id": order.ID,
|
||||||
|
"order": order,
|
||||||
|
}
|
||||||
|
|
||||||
|
RespOK(c, ret)
|
||||||
|
} else { // 其他则默认明慧账户收费
|
||||||
webPay, err := wxpay.HmJsPayUnifiedOrderForBuyGoods(order.SerialNo, order.Rm, user.WxOpenID, configInfo.NotifyUrl)
|
webPay, err := wxpay.HmJsPayUnifiedOrderForBuyGoods(order.SerialNo, order.Rm, user.WxOpenID, configInfo.NotifyUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(errors.New("WebPay err"))
|
logger.Error(errors.New("WebPay err"))
|
||||||
|
@ -463,6 +480,7 @@ func MallOrderCreate(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RespOK(c, ret)
|
RespOK(c, ret)
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,10 @@ const (
|
||||||
Rmb = 100
|
Rmb = 100
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AccountForDw = 2 // 迪为账户
|
||||||
|
)
|
||||||
|
|
||||||
// 商品
|
// 商品
|
||||||
// gen:qs
|
// gen:qs
|
||||||
//
|
//
|
||||||
|
@ -77,6 +81,7 @@ type Goods struct {
|
||||||
DealType uint32 `json:"deal_type"` // 1-积分兑换 2-购买 3-抵扣
|
DealType uint32 `json:"deal_type"` // 1-积分兑换 2-购买 3-抵扣
|
||||||
VersionId uint64 `json:"version_id"` // 乐观锁
|
VersionId uint64 `json:"version_id"` // 乐观锁
|
||||||
ShowDiscount int8 `json:"show_discount"` //
|
ShowDiscount int8 `json:"show_discount"` //
|
||||||
|
GoodsAccountNum uint32 `json:"goods_account_num"` // 收款账户编号
|
||||||
|
|
||||||
GoodsCat *GoodsCat `json:"goods_cat" gorm:"-"`
|
GoodsCat *GoodsCat `json:"goods_cat" gorm:"-"`
|
||||||
GoodsDiscount *GoodsDiscount `json:"goods_discount" gorm:"-"`
|
GoodsDiscount *GoodsDiscount `json:"goods_discount" gorm:"-"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user