提交 8aa931f4 编写于 作者: M monomania

1.修正c1bug

上级 802896cf
......@@ -42,6 +42,10 @@ func main() {
launch.Spider()
case "analy\n", "analy":
launch2.Analy()
case "baseFace\n", "baseFace":
launch.Spider_match(4)
launch.Spider_asiaLastNew(true)
launch.Spider_baseFace(true)
case "limit\n", "limit":
pubLimitService := new(service.PubLimitService)
publimit := pubLimitService.GetPublimit()
......
......@@ -45,6 +45,11 @@ HEAD:
case "analy\n", "analy\r\n":
launch2.Analy()
goto HEAD
case "baseFace\n", "baseFace\r\n":
launch.Spider_match(4)
launch.Spider_asiaLastNew(true)
launch.Spider_baseFace(true)
goto HEAD
case "limit\n", "limit\r\n":
pubLimitService := new(service.PubLimitService)
publimit := pubLimitService.GetPublimit()
......
......@@ -7,7 +7,7 @@ import (
func main() {
//开启SQL输出
launch.Before_spider_baseFace()
//launch.Before_spider_baseFace()
launch.Spider_match(4)
launch.Spider_asiaLastNew(true)
launch.Spider_baseFace(true)
......
......@@ -51,8 +51,9 @@ func (this *A1Service) Analy_Process(matchList []*pojo.MatchLast) {
if stub == 0 || stub == 1 {
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hours = math.Abs(hours * 0.5)
data.THitCount = int(hours)
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
}else{
data.THitCount = 1
}
......
......@@ -21,6 +21,7 @@ type AnalyService struct {
service.EuroLastService
service.EuroHisService
service.AsiaLastService
service.AsiaHisService
service2.MatchLastService
service2.MatchHisService
service3.LeagueService
......
......@@ -54,8 +54,9 @@ func (this *C1Service) Analy_Process(matchList []*pojo.MatchLast) {
if stub == 0 || stub == 1 {
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hours = math.Abs(hours * 0.5)
data.THitCount = int(hours)
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
}
......@@ -196,11 +197,9 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
} else if a18betData.ELetBall < 0 {
mainLetball = false
} else {
if a18betData.SLetBall > 0 {
mainLetball = true
} else if a18betData.SLetBall < 0 {
if a18betData.SLetBall > 0 && a18betData.ELetBall <= 0 {
mainLetball = false
} else {
} else {
if letBall >= 0 {
mainLetball = true
} else {
......@@ -218,8 +217,10 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
eLetBall := math.Abs(a18betData.ELetBall)
tLetBall := math.Abs(letBall)
ableUpDown := false
if math.Abs(sLetBall-eLetBall) <= 0.25 {
ableOdd := 0.075
if math.Abs(sLetBall-eLetBall) <= 0.25 && sLetBall != 0 && eLetBall != 0{
ableUpDown = true
ableOdd = 0.25
}
if (sLetBall >= tLetBall && eLetBall >= tLetBall) || (sLetBall < tLetBall && eLetBall >= tLetBall) {
......@@ -233,7 +234,7 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
}else{
seLetBall = eLetBall
}
if math.Abs(seLetBall-tLetBall) <= 0.25 {
if math.Abs(seLetBall-tLetBall) <= ableOdd{
if mainLetball {
preResult = 3
} else {
......@@ -257,7 +258,7 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
}else{
seLetBall = eLetBall
}
if math.Abs(tLetBall-seLetBall) <= 0.25 {
if math.Abs(tLetBall-seLetBall) <= ableOdd {
if mainLetball {
preResult = 3
} else {
......
......@@ -44,8 +44,9 @@ func (this *E1Service) Analy_Process(matchList []*pojo.MatchLast) {
if stub == 0 || stub == 1 {
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hours = math.Abs(hours * 0.5)
data.THitCount = int(hours)
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
}
......
......@@ -49,8 +49,9 @@ func (this *E2Service) Analy_Process(matchList []*pojo.MatchLast) {
if stub == 0 || stub == 1 {
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hours = math.Abs(hours * 0.5)
data.THitCount = int(hours)
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
}
......
......@@ -43,8 +43,9 @@ func (this *Q1Service) Analy_Process(matchList []*pojo.MatchLast) {
if stub == 0 || stub == 1 {
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hours = math.Abs(hours * 0.5)
data.THitCount = int(hours)
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
}
......
package service
import (
"strings"
"tesou.io/platform/foot-parent/foot-api/common/base"
"tesou.io/platform/foot-parent/foot-api/module/odds/pojo"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
......@@ -17,3 +18,31 @@ func (this *AsiaHisService) FindExists(v *pojo.AsiaHis) bool {
}
return exist
}
//根据比赛ID查找亚赔
func (this *AsiaHisService) FindByMatchId(matchId string) []*pojo.AsiaHis {
dataList := make([]*pojo.AsiaHis, 0)
err := mysql.GetEngine().Where(" MatchId = ? ", matchId).Find(dataList)
if err != nil {
base.Log.Error("FindByMatchId:", err)
}
return dataList
}
//根据比赛ID和波菜公司ID查找亚赔
func (this *AsiaHisService) FindByMatchIdCompId(matchId string, compIds ...string) []*pojo.AsiaHis {
dataList := make([]*pojo.AsiaHis, 0)
sql_build := strings.Builder{}
sql_build.WriteString(" MatchId = '" + matchId + "' AND CompId in ( '0' ")
for _, v := range compIds {
sql_build.WriteString(" ,'")
sql_build.WriteString(v)
sql_build.WriteString("'")
}
sql_build.WriteString(")")
err := mysql.GetEngine().Where(sql_build.String()).Find(&dataList)
if err != nil {
base.Log.Error("FindByMatchIdCompId:", err)
}
return dataList
}
......@@ -31,7 +31,7 @@ func (this *AsiaLastService) FindByMatchId(matchId string) []*pojo.AsiaLast {
return dataList
}
//根据比赛ID和波菜公司ID查找
//根据比赛ID和波菜公司ID查找
func (this *AsiaLastService) FindByMatchIdCompId(matchId string, compIds ...string) []*pojo.AsiaLast {
dataList := make([]*pojo.AsiaLast, 0)
sql_build := strings.Builder{}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册