|
@@ -17,6 +17,7 @@ import (
|
|
|
func GetCouponInfo(userId, lotteryId, pCode string) (full, reduce int, discount float64, userLotteryId string) {
|
|
|
lttid := qutil.SE.Decode4Hex(lotteryId)
|
|
|
getUrl := fmt.Sprintf("%s?userId=%s&appId=%s&lotteryId=%s", config.CouponConfig.CouponInfo, userId, config.CouponConfig.AppId, lttid)
|
|
|
+ log.Println("url:", getUrl)
|
|
|
res, err := http.Get(getUrl)
|
|
|
if err != nil {
|
|
|
log.Println(err.Error())
|
|
@@ -49,7 +50,8 @@ func GetCouponInfo(userId, lotteryId, pCode string) (full, reduce int, discount
|
|
|
for _, pv := range useProductList {
|
|
|
//当前产品是否可用
|
|
|
productCode := strconv.FormatInt(qutil.Int64All(pv["productCode"]), 10) //104
|
|
|
- if productCode == pCode || string([]rune(pCode)[:3]) == productCode {
|
|
|
+ parentCode := strconv.FormatInt(qutil.Int64All(pv["parentCode"]), 10)
|
|
|
+ if productCode == pCode || string([]rune(pCode)[:3]) == productCode || string([]rune(pCode)[:3]) == parentCode {
|
|
|
isExists = true
|
|
|
break
|
|
|
}
|
|
@@ -69,7 +71,6 @@ func GetCouponInfo(userId, lotteryId, pCode string) (full, reduce int, discount
|
|
|
endDate = thisTime.Unix()
|
|
|
}
|
|
|
//未开始 已结束 则不可用
|
|
|
- log.Println(beginDate, "---", time.Now().Unix(), "---", endDate)
|
|
|
if beginDate > time.Now().Unix() || endDate < time.Now().Unix() {
|
|
|
isExists = false
|
|
|
}
|