|
@@ -713,7 +713,12 @@ func DealUserCoin(session *xorm.Session, req md.DealUserCoinReq) (err error) { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
if zhios_order_relate_utils.StrToFloat64(userVirtualCoinFlow.AfterAmout) < 0 { |
|
|
if zhios_order_relate_utils.StrToFloat64(userVirtualCoinFlow.AfterAmout) < 0 { |
|
|
return errors.New("用户虚拟币积分不足,无法扣除。") |
|
|
|
|
|
|
|
|
var coin model.VirtualCoin |
|
|
|
|
|
_, err = session.Where("id = ?", req.CoinId).Get(&coin) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
return errors.New("用户" + coin.Name + "不足") |
|
|
} |
|
|
} |
|
|
//3、插入 `user_virtual_coin_flow` 记录 |
|
|
//3、插入 `user_virtual_coin_flow` 记录 |
|
|
_, err = db.UserVirtualCoinFlowInsert(session, &userVirtualCoinFlow) |
|
|
_, err = db.UserVirtualCoinFlowInsert(session, &userVirtualCoinFlow) |
|
|