|
|
@@ -38,6 +38,23 @@ func CheckSetting(eg *xorm.Engine, pvd string) bool { |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
func CheckSettingSess(sess *xorm.Session, pvd string) bool { |
|
|
|
setting := GetDayLuckDrawSettingSess(sess) |
|
|
|
if setting == nil { |
|
|
|
return false |
|
|
|
} |
|
|
|
now := time.Now().Unix() |
|
|
|
if setting.IsUse == 0 || setting.StartTime.IsZero() || setting.EndTime.IsZero() { |
|
|
|
return false |
|
|
|
} |
|
|
|
if now < setting.StartTime.Unix() || now > setting.EndTime.Unix() { |
|
|
|
return false |
|
|
|
} |
|
|
|
if setting.OrderSoruce == "mall" && pvd != "" && zhios_day_luck_draw_utils.InArr(pvd, []string{"mall_goods", "mall_group_buy", "mall_goods_user_lv", "super_group_buy", "mall_supply", "mall_group_own_buy"}) == false { |
|
|
|
return false |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
func GetDayLuckDrawSettingSess(sess *xorm.Session) *model.DayLuckDrawSetting { |
|
|
|
var data model.DayLuckDrawSetting |
|
|
|
get, err := sess.Get(&data) |
|
|
|