index.go 398 Bytes
package confbase

import (
	"apigame/service-common/svmysql"
	"apigame/util/util-lx/lxtime"
)

func FindDuringTime(obj svmysql.IMysqlData, gameId string) (has bool) {
	info := obj.MysqlInfo(gameId)
	db := info.DbMysql
	timeNow := lxtime.NowUninx()
	result := db.Table(info.TableName).Where("start_time <= ? AND end_time >= ?", timeNow, timeNow).First(obj)
	has = result.RowsAffected != 0
	return
}