This commit is contained in:
li 2022-12-13 14:11:54 +08:00
parent a01e8fdfd2
commit 932fcf597f
4 changed files with 22 additions and 19 deletions

View File

@ -249,9 +249,9 @@ func RentCardOrderCreate(c *gin.Context) {
rentCard = &model.UserRentCard{LevelRentCount: memberConfig.CardMax, CanRentCount: memberConfig.CardMax} rentCard = &model.UserRentCard{LevelRentCount: memberConfig.CardMax, CanRentCount: memberConfig.CardMax}
} }
if uc.Uid == 15304136 || uc.Uid == 45935373 { //if uc.Uid == 45935373 {
rentCard.CanRentCount -= 1 // rentCard.CanRentCount -= 1
} //}
if cardCount > rentCard.CanRentCount { if cardCount > rentCard.CanRentCount {
logger.Error("GetMemberConfig err:", err) logger.Error("GetMemberConfig err:", err)
RespJson(c, status.OrderOutRentCount, nil) RespJson(c, status.OrderOutRentCount, nil)

View File

@ -1074,7 +1074,7 @@ type HmPayBizContent struct {
// AccessPartyCode string `json:"access_party_code"` // AccessPartyCode string `json:"access_party_code"`
//} `json:"extend_params"` //} `json:"extend_params"`
//GoodsDetails []HmPayGoodsDetails `json:"goods_details"` //GoodsDetails []HmPayGoodsDetails `json:"goods_details"`
LimitPay string `json:"limit_pay"` //LimitPay string `json:"limit_pay"`
NotifyUrl string `json:"notify_url"` NotifyUrl string `json:"notify_url"`
//OperatorId string `json:"operator_id"` //OperatorId string `json:"operator_id"`
OutOrderNo string `json:"out_order_no"` OutOrderNo string `json:"out_order_no"`
@ -1157,13 +1157,13 @@ func HmJsPayUnifiedOrder(orderId string, totalFee uint32, openId, notifyUrl stri
} }
biz := HmPayBizContent{ biz := HmPayBizContent{
Body: "服务费", Body: "服务费",
MerAppId: WxAppId, MerAppId: WxAppId,
MerBuyerId: openId, MerBuyerId: openId,
CreateIp: clientIp, CreateIp: clientIp,
CreateTime: strTime, CreateTime: strTime,
ExpireTime: strExpireTime, ExpireTime: strExpireTime,
LimitPay: "NO_CREDIT", //LimitPay: "NO_CREDIT",
NotifyUrl: notifyUrl, NotifyUrl: notifyUrl,
OutOrderNo: orderId, OutOrderNo: orderId,
PayType: "JSAPI", PayType: "JSAPI",

View File

@ -1057,14 +1057,17 @@ func TestOrderCancelId(t *testing.T) {
//} //}
func TestGameCardGoodsStockInspection(t *testing.T) { func TestGameCardGoodsStockInspection(t *testing.T) {
GameCardGoodsStockInspection() InitDBProd()
ids := []uint32{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26}
for i, _ := range ids {
GameCardGoodsStockInspection(ids[i])
}
} }
func GameCardGoodsStockInspection() { func GameCardGoodsStockInspection(id uint32) {
InitDBProd()
var gameCardGoodses []GameCardGoods var gameCardGoodses []GameCardGoods
err := NewGameCardGoodsQuerySet(DBProd).StoreIdEq(16).All(&gameCardGoodses) err := NewGameCardGoodsQuerySet(DBProd).StoreIdEq(uint64(id)).All(&gameCardGoodses)
if err != nil { if err != nil {
logger.Error("err:", err) logger.Error("err:", err)
} }
@ -1076,12 +1079,12 @@ func GameCardGoodsStockInspection() {
//rentMap[uint32(gameCard.StoreId)] += 1 //rentMap[uint32(gameCard.StoreId)] += 1
rentMap[uint32(gameCard.GameCardId)] += 1 rentMap[uint32(gameCard.GameCardId)] += 1
} }
if gameCard.Status == 3 { if gameCard.Status == 3 || gameCard.Status == 2 {
holdMap[uint32(gameCard.GameCardId)] += 1 holdMap[uint32(gameCard.GameCardId)] += 1
} }
} }
var gameCardGoodsStocks []GameCardGoodsStock var gameCardGoodsStocks []GameCardGoodsStock
err = NewGameCardGoodsStockQuerySet(DBProd).StoreIdEq(16).All(&gameCardGoodsStocks) err = NewGameCardGoodsStockQuerySet(DBProd).StoreIdEq(uint64(id)).All(&gameCardGoodsStocks)
if err != nil { if err != nil {
logger.Error("err:", err) logger.Error("err:", err)
} }