This commit is contained in:
li 2022-04-22 09:53:43 +08:00
parent 3bc349cf5f
commit 4059e15450
3 changed files with 6 additions and 2 deletions

View File

@ -665,7 +665,7 @@ func CardIssueCreate(c *gin.Context) {
return
}
if !shareCardRetrieveCard.ReceiptTime.IsZero() && shareCardRetrieveCard.ReceiptTime.
AddDate(0, 0, 2).After(time.Now()) {
AddDate(0, 0, 2).Before(time.Now()) {
logger.Error("receipt time is over 48 hour:")
RespJson(c, status.IssueFeedbackReceiptTimeOver48Hour, nil)
return

View File

@ -156,6 +156,8 @@ func InitDBProd() {
DBProd.AutoMigrate(
&RedeemCode{},
&UserRedeemCode{},
&GameCardGoods{},
&UserShareCardBill{},
&ShareCardBillGame{},

View File

@ -453,7 +453,9 @@ func GetUserShareCardGameList(uid uint32, page, pageSize int, label string) ([]G
Count int `json:"count"`
}
var count GameCount
countSql := strings.Replace(sql, "SELECT *", "SELECT COUNT(*) ", -1)
countSql := strings.Replace(sql, "SELECT *", "SELECT COUNT(*) AS count ", -1)
//countSql := strings.Replace(sql, "SELECT *", "SELECT COUNT(*) ", -1)
fmt.Println("countSql:", countSql)
err := DB.Raw(countSql).Scan(&count).Error
//count, err := qs.Count()
if err != nil {