fix:
This commit is contained in:
parent
6fa60b68e6
commit
87ea25f0d5
|
@ -18,7 +18,7 @@ func runServer() {
|
||||||
gin.SetMode(gin.DebugMode)
|
gin.SetMode(gin.DebugMode)
|
||||||
|
|
||||||
router.ConfigAppRouter(server)
|
router.ConfigAppRouter(server)
|
||||||
|
//OrderCancelId()
|
||||||
err := server.Run(fmt.Sprintf(":%d", config.AppConfig.ServerPort))
|
err := server.Run(fmt.Sprintf(":%d", config.AppConfig.ServerPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
|
@ -47,3 +47,86 @@ func init() {
|
||||||
|
|
||||||
utils.InitSnowFlakeByGo()
|
utils.InitSnowFlakeByGo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//func OrderCancelId() {
|
||||||
|
// //ids := []uint32{8288, 8265}
|
||||||
|
// ids := []uint32{8335}
|
||||||
|
// for _, id := range ids {
|
||||||
|
// //OrderCancel(id)
|
||||||
|
// OrderCancel(id)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//func OrderCancel(id uint32) {
|
||||||
|
// InitDBProd()
|
||||||
|
// model.DB = DBProd
|
||||||
|
// var order model.Order
|
||||||
|
// err := model.NewOrderQuerySet(model.DB).IDEq(id).One(&order)
|
||||||
|
// if err != nil {
|
||||||
|
// fmt.Println("err:", err)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// outTradeNo, err := model.GetWxPayExpressFeeRefundRecord(order.ID)
|
||||||
|
// if err != nil {
|
||||||
|
// logger.Error("err:", err)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// orderSn :=model.GetOrderSn()
|
||||||
|
// err = model.UserOpenMemberRecord{Uid: uint32(order.Uid), OpenNo: orderSn, OrderId: order.ID, OrderType: 2}.Insert()
|
||||||
|
// if err != nil {
|
||||||
|
// logger.Error(errors.New("WebPay err"))
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// orderRefund := wxpay.OrderRefund{
|
||||||
|
// OutTradeNo: outTradeNo,
|
||||||
|
// OutRefundNo: orderSn,
|
||||||
|
// NotifyUrl: "",
|
||||||
|
// Amount: wxpay.OrderRefundAmount{
|
||||||
|
// Refund: order.PayPrice,
|
||||||
|
// Total: order.PayPrice,
|
||||||
|
// Currency: "CNY",
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
// bytes, _ := json.Marshal(order)
|
||||||
|
// fmt.Println("订单取消:", string(bytes))
|
||||||
|
// orderRefundJson, _ := json.Marshal(&orderRefund)
|
||||||
|
// fmt.Println("订单取消 orderRefundJson:", string(orderRefundJson))
|
||||||
|
// //err = wxpay.WxPayOrderRefund(orderRefund)
|
||||||
|
// err = wxpay.TransactionOrderRefund(orderRefund)
|
||||||
|
// if err != nil {
|
||||||
|
// logger.Error("err:", err)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//var DBProd *gorm.DB
|
||||||
|
//
|
||||||
|
//func InitDBProd() {
|
||||||
|
// var err error
|
||||||
|
// dialect := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||||
|
// "mh_pro", "fLeytnBFCRB553ab", "39.108.188.218", "3306",
|
||||||
|
// "mh_pro")
|
||||||
|
//
|
||||||
|
// DBProd, err = gorm.Open("mysql", dialect)
|
||||||
|
// if err != nil {
|
||||||
|
// fmt.Println("Connect Database Error, error = ", err)
|
||||||
|
// panic(err)
|
||||||
|
// }
|
||||||
|
// DBProd.DB().SetMaxOpenConns(1000)
|
||||||
|
// DBProd.DB().SetMaxIdleConns(500)
|
||||||
|
// DBProd.DB().SetConnMaxLifetime(time.Second * 10)
|
||||||
|
// //DBProd.LogMode(true)
|
||||||
|
// DBProd.LogMode(false)
|
||||||
|
// DBProd.SingularTable(true)
|
||||||
|
// DBProd.AutoMigrate(
|
||||||
|
// )
|
||||||
|
//
|
||||||
|
// if err := DBProd.DB().Ping(); err != nil {
|
||||||
|
// fmt.Println("Ping Database Fail, error = ", err)
|
||||||
|
// panic(err)
|
||||||
|
// }
|
||||||
|
// fmt.Println("DB init success")
|
||||||
|
//}
|
|
@ -246,6 +246,7 @@ func RentCardOrderCreate(c *gin.Context) {
|
||||||
//return
|
//return
|
||||||
fmt.Println("CardMax", memberConfig.CardMax)
|
fmt.Println("CardMax", memberConfig.CardMax)
|
||||||
rentCard = &model.UserRentCard{LevelRentCount: memberConfig.CardMax, CanRentCount: memberConfig.CardMax}
|
rentCard = &model.UserRentCard{LevelRentCount: memberConfig.CardMax, CanRentCount: memberConfig.CardMax}
|
||||||
|
|
||||||
}
|
}
|
||||||
fmt.Println("rentCard", rentCard.CanRentCount)
|
fmt.Println("rentCard", rentCard.CanRentCount)
|
||||||
if cardCount > rentCard.CanRentCount {
|
if cardCount > rentCard.CanRentCount {
|
||||||
|
|
|
@ -787,11 +787,11 @@ func SyncUserRent() {
|
||||||
}
|
}
|
||||||
fmt.Println("订单 count: uid:", orderCount, user.Uid)
|
fmt.Println("订单 count: uid:", orderCount, user.Uid)
|
||||||
|
|
||||||
_, err = NewUserRentCardQuerySet(DBProd).UidEq(user.Uid).GetUpdater().SetCanRentCount(0).
|
//_, err = NewUserRentCardQuerySet(DBProd).UidEq(user.Uid).GetUpdater().SetCanRentCount(0).
|
||||||
SetHaveRentCount(1).UpdateNum()
|
// SetHaveRentCount(1).UpdateNum()
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
fmt.Println("err:", err)
|
// fmt.Println("err:", err)
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user