Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
加钱居士.
foot
提交
adfed63c
F
foot
项目概览
加钱居士.
/
foot
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
foot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
adfed63c
编写于
2月 06, 2020
作者:
M
monomania
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.处理提前计算结果的bug
上级
27475c64
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
247 addition
and
68 deletion
+247
-68
FOOT000.go
FOOT000.go
+1
-0
FOOT000Cmd.go
FOOT000Cmd.go
+1
-0
FOOT000Test.go
FOOT000Test.go
+17
-3
assets/wechat/html/today_a1.html
assets/wechat/html/today_a1.html
+4
-4
assets/wechat/html/today_c1.html
assets/wechat/html/today_c1.html
+4
-4
assets/wechat/html/today_tbs.html
assets/wechat/html/today_tbs.html
+4
-4
conf/app.ini
conf/app.ini
+2
-2
foot-core/module/analy/service/AnalyService.go
foot-core/module/analy/service/AnalyService.go
+10
-8
foot-core/module/analy/service/C1Service.go
foot-core/module/analy/service/C1Service.go
+1
-1
foot-core/module/analy/service/E2Service.go
foot-core/module/analy/service/E2Service.go
+2
-2
foot-core/module/leisu/service/LeisuService.go
foot-core/module/leisu/service/LeisuService.go
+29
-14
foot-core/module/leisu/service/PubService.go
foot-core/module/leisu/service/PubService.go
+11
-11
foot-core/module/match/service/MatchLastService.go
foot-core/module/match/service/MatchLastService.go
+1
-1
foot-core/module/spider/constants/Constant.go
foot-core/module/spider/constants/Constant.go
+4
-2
foot-core/module/suggest/service/SuggestService.go
foot-core/module/suggest/service/SuggestService.go
+151
-10
foot-core/module/wechat/service/MessageService.go
foot-core/module/wechat/service/MessageService.go
+1
-1
foot-core/module/wechat/service/SuggestTodayService.go
foot-core/module/wechat/service/SuggestTodayService.go
+4
-1
未找到文件。
FOOT000.go
浏览文件 @
adfed63c
...
...
@@ -148,6 +148,7 @@ func main() {
// time.Sleep(time.Duration(pubService.CycleTime()) * time.Minute)
// }
//}()
time
.
Sleep
(
1
*
time
.
Second
)
for
{
matchLastService
:=
new
(
service3
.
MatchLastService
)
matchLasts
:=
matchLastService
.
FindNear
()
...
...
FOOT000Cmd.go
浏览文件 @
adfed63c
...
...
@@ -165,6 +165,7 @@ HEAD:
// time.Sleep(time.Duration(pubService.CycleTime()) * time.Minute)
// }
//}()
time
.
Sleep
(
1
*
time
.
Second
)
go
func
()
{
for
{
matchLastService
:=
new
(
service3
.
MatchLastService
)
...
...
FOOT000Test.go
浏览文件 @
adfed63c
...
...
@@ -3,7 +3,9 @@ package main
import
(
"fmt"
"strconv"
service2
"tesou.io/platform/foot-parent/foot-core/module/analy/service"
"tesou.io/platform/foot-parent/foot-core/module/spider/constants"
"tesou.io/platform/foot-parent/foot-core/module/wechat/service"
"time"
)
func
abort
(
funcname
string
,
err
string
)
{
...
...
@@ -23,9 +25,21 @@ func Decimal(value float64) float64 {
}
var
aaa
int
func
set
()
{
constants
.
SpiderDateStr
=
time
.
Now
()
.
Format
(
"2006-01-02 15:04:05"
)
constants
.
FullSpiderDateStr
=
constants
.
SpiderDateStr
}
func
main
(){
flag
:=
new
(
service2
.
AnalyService
)
.
FindOtherAlFlag
(
"1721915"
,
"C1"
,
3
)
fmt
.
Println
(
flag
)
go
func
()
{
set
()
new
(
service
.
SuggestTodayService
)
.
Print11
()
}()
time
.
Sleep
(
1
*
time
.
Second
)
}
//func main() {
...
...
assets/wechat/html/today_a1.html
浏览文件 @
adfed63c
...
...
@@ -27,21 +27,18 @@
<table
style=
"font-size: 12px;font-weight: bold"
>
<tr>
<td>
模型
</td>
<td>
指数
</td>
<td>
时间
</td>
<td>
联赛
</td>
<td>
主队(让球)客队
</td>
<td>
比分
</td>
<td>
推荐
</td>
<td>
指数
</td>
</tr>
{{if .DataList}}
{{with .DataList}}
{{range .}}
<tr>
<td><span
style=
"color: {{color .AlFlag}}"
>
{{.AlFlag}}
</span></td>
<td
style=
"color: red"
>
<strong>
{{.HitCount}}
</strong>
</td>
<td>
{{.MatchDateStr}}
</td>
<td>
{{.LeagueName}}
</td>
<td>
...
...
@@ -55,6 +52,9 @@
<td
style=
"background-color: {{resultColor .Result}}"
>
{{preResultStr .PreResult .AlFlag}}
</td>
<td
style=
"color: red"
>
<strong>
{{.HitCount}}
</strong>
</td>
</tr>
{{end}}
{{end}}
...
...
assets/wechat/html/today_c1.html
浏览文件 @
adfed63c
...
...
@@ -28,21 +28,18 @@
<table
style=
"font-size: 12px;font-weight: bold"
>
<tr>
<td>
模型
</td>
<td
style=
"min-width: 58px"
>
BF让球
</td>
<td>
时间
</td>
<td>
联赛
</td>
<td>
主队(让球)客队
</td>
<td>
比分
</td>
<td>
推荐
</td>
<td
style=
"min-width: 58px"
>
BF让球
</td>
</tr>
{{if .DataList}}
{{with .DataList}}
{{range .}}
<tr>
<td><span
style=
"color: {{color .AlFlag}}"
>
{{.AlFlag}}
</span></td>
<td
style=
"color: red"
>
{{.MyLetBall}}
</td>
<td>
{{.MatchDateStr}}
</td>
<td>
{{.LeagueName}}
</td>
<td>
...
...
@@ -56,6 +53,9 @@
<td
style=
"background-color: {{resultColor .Result}}"
>
{{preResultStr .PreResult .AlFlag}}
</td>
<td
style=
"color: red"
>
{{.MyLetBall}}
</td>
</tr>
{{end}}
{{end}}
...
...
assets/wechat/html/today_tbs.html
浏览文件 @
adfed63c
...
...
@@ -27,21 +27,18 @@
<table
style=
"font-size: 12px;font-weight: bold"
>
<tr>
<td>
模型
</td>
<td>
指数
</td>
<td>
时间
</td>
<td>
联赛
</td>
<td>
主队(让球)客队
</td>
<td>
比分
</td>
<td>
推荐
</td>
<td>
指数
</td>
</tr>
{{if .DataList}}
{{with .DataList}}
{{range .}}
<tr>
<td><span
style=
"color: {{color .AlFlag}}"
>
{{.AlFlag}}
</span></td>
<td
style=
"color: red"
>
<strong>
{{.HitCount}}
</strong>
</td>
<td>
{{.MatchDateStr}}
</td>
<td>
{{.LeagueName}}
</td>
<td>
...
...
@@ -55,6 +52,9 @@
<td
style=
"background-color: {{resultColor .Result}}"
>
{{preResultStr .PreResult .AlFlag}}
</td>
<td
style=
"color: red"
>
<strong>
{{.HitCount}}
</strong>
</td>
</tr>
{{end}}
{{end}}
...
...
conf/app.ini
浏览文件 @
adfed63c
[mysql]
#
url=root:Meta.123@tcp(mysql.io:3306)/foot?charset=utf8
url
=
root:awe.FOG5188@tcp(39.108.212.245:3306)/foot?charset=utf8
url
=
root:Meta.123@tcp(mysql.io:3306)/foot?charset=utf8
#
url=root:awe.FOG5188@tcp(39.108.212.245:3306)/foot?charset=utf8
maxIdle
=
10
maxConn
=
50
[cookies]
...
...
foot-core/module/analy/service/AnalyService.go
浏览文件 @
adfed63c
...
...
@@ -4,6 +4,7 @@ import (
"fmt"
"math"
"strconv"
"strings"
"tesou.io/platform/foot-parent/foot-api/common/base"
entity5
"tesou.io/platform/foot-parent/foot-api/module/analy/pojo"
"tesou.io/platform/foot-parent/foot-api/module/analy/vo"
...
...
@@ -99,7 +100,7 @@ FROM
last
.
MainTeamGoals
=
his
.
MainTeamGoals
last
.
GuestTeamId
=
his
.
GuestTeamId
last
.
GuestTeamGoals
=
his
.
GuestTeamGoals
if
e
.
AlFlag
==
"E2"
||
e
.
AlFlag
==
"C1"
{
if
strings
.
EqualFold
(
e
.
AlFlag
,
"E2"
)
||
strings
.
EqualFold
(
e
.
AlFlag
,
"C1"
)
{
//E2使用特别自身的验证结果方法
e
.
Result
=
this
.
IsRight2Option
(
last
,
e
)
}
else
{
...
...
@@ -146,7 +147,7 @@ WHERE DATE_ADD(ar.MatchDate, INTERVAL 3 HOUR) > NOW()
last
.
MainTeamGoals
=
his
.
MainTeamGoals
last
.
GuestTeamId
=
his
.
GuestTeamId
last
.
GuestTeamGoals
=
his
.
GuestTeamGoals
if
e
.
AlFlag
==
"E2"
||
e
.
AlFlag
==
"C1"
{
if
strings
.
EqualFold
(
e
.
AlFlag
,
"E2"
)
||
strings
.
EqualFold
(
e
.
AlFlag
,
"C1"
)
{
//E2使用特别自身的验证结果方法
e
.
Result
=
this
.
IsRight2Option
(
last
,
e
)
}
else
{
...
...
@@ -227,9 +228,10 @@ WHERE ml.id = el.matchid
func
(
this
*
AnalyService
)
IsRight2Option
(
v
*
entity2
.
MatchLast
,
analy
*
entity5
.
AnalyResult
)
string
{
//比赛结果
var
globalResult
int
h2
,
_
:=
time
.
ParseDuration
(
"158m"
)
matchDate
:=
v
.
MatchDate
.
Add
(
h2
)
if
matchDate
.
After
(
time
.
Now
())
{
h2
,
_
:=
time
.
ParseDuration
(
"129m"
)
//比赛结束的时间点
matchEndDate
:=
v
.
MatchDate
.
Add
(
h2
)
if
matchEndDate
.
Before
(
time
.
Now
())
{
//比赛未结束
globalResult
=
-
1
}
else
{
...
...
@@ -283,9 +285,9 @@ func (this *AnalyService) IsRight(last *entity2.MatchLast, analy *entity5.AnalyR
*/
func
(
this
*
AnalyService
)
ActualResult
(
last
*
entity2
.
MatchLast
,
analy
*
entity5
.
AnalyResult
)
int
{
var
result
int
h2
,
_
:=
time
.
ParseDuration
(
"1
58
m"
)
matchDate
:=
last
.
MatchDate
.
Add
(
h2
)
if
match
Date
.
After
(
time
.
Now
())
{
h2
,
_
:=
time
.
ParseDuration
(
"1
29
m"
)
match
End
Date
:=
last
.
MatchDate
.
Add
(
h2
)
if
match
EndDate
.
Before
(
time
.
Now
())
{
//比赛未结束
return
-
1
}
...
...
foot-core/module/analy/service/C1Service.go
浏览文件 @
adfed63c
...
...
@@ -328,7 +328,7 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
temp_data
:=
this
.
Find
(
v
.
Id
,
this
.
ModelName
())
if
len
(
temp_data
.
Id
)
>
0
{
temp_data
.
PreResult
=
preResult
temp_data
.
HitCount
=
temp_data
.
HitCount
+
1
0
temp_data
.
HitCount
=
temp_data
.
HitCount
+
1
temp_data
.
LetBall
=
a18betData
.
ELetBall
temp_data
.
MyLetBall
=
Decimal
(
letBall
)
data
=
temp_data
...
...
foot-core/module/analy/service/E2Service.go
浏览文件 @
adfed63c
...
...
@@ -148,7 +148,7 @@ func (this *E2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
temp_data
.
LetBall
=
a18betData
.
ELetBall
data
=
temp_data
//比赛结果
data
.
Result
=
this
.
IsRight
(
v
,
data
)
data
.
Result
=
this
.
IsRight
2Option
(
v
,
data
)
return
1
,
data
}
else
{
data
=
new
(
entity5
.
AnalyResult
)
...
...
@@ -162,7 +162,7 @@ func (this *E2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
data
.
HitCount
=
1
data
.
LetBall
=
a18betData
.
ELetBall
//比赛结果
data
.
Result
=
this
.
IsRight
(
v
,
data
)
data
.
Result
=
this
.
IsRight
2Option
(
v
,
data
)
return
0
,
data
}
}
...
...
foot-core/module/leisu/service/LeisuService.go
浏览文件 @
adfed63c
...
...
@@ -3,33 +3,48 @@ package service
import
(
"strconv"
"strings"
"tesou.io/platform/foot-parent/foot-api/module/analy
/vo"
vo2
"tesou.io/platform/foot-parent/foot-api/module/suggest
/vo"
"tesou.io/platform/foot-parent/foot-core/common/utils"
"tesou.io/platform/foot-parent/foot-core/module/analy/service"
"tesou.io/platform/foot-parent/foot-core/module/leisu/constants"
"tesou.io/platform/foot-parent/foot-core/module/suggest/service"
"time"
)
type
LeisuService
struct
{
service
.
Analy
Service
service
.
Suggest
Service
}
/**
获取可发布的数据
*/
func
(
this
*
LeisuService
)
ListPubAbleData
()
[]
*
vo
.
AnalyResultVO
{
teamOption
:=
this
.
teamOption
()
al_flag
:=
utils
.
GetVal
(
constants
.
SECTION_NAME
,
"al_flag"
)
hit_count_str
:=
utils
.
GetVal
(
constants
.
SECTION_NAME
,
"hit_count"
)
hit_count
,
_
:=
strconv
.
Atoi
(
hit_count_str
)
func
(
this
*
LeisuService
)
ListPubAbleData
()
[]
*
vo2
.
SuggStubDetailVO
{
//获取分析计算出的比赛列表
analyList
:=
this
.
AnalyService
.
List
(
al_flag
,
hit_count
,
teamOption
)
return
analyList
param
:=
new
(
vo2
.
SuggStubDetailVO
)
now
:=
time
.
Now
()
h12
,
_
:=
time
.
ParseDuration
(
"-1h"
)
beginDate
:=
now
.
Add
(
h12
)
param
.
BeginDateStr
=
beginDate
.
Format
(
"2006-01-02 15:04:05"
)
h12
,
_
=
time
.
ParseDuration
(
"24h"
)
endDate
:=
now
.
Add
(
h12
)
param
.
EndDateStr
=
endDate
.
Format
(
"2006-01-02 15:04:05"
)
//只推送稳胆
tempList
:=
this
.
SuggestService
.
QueryLeisu
(
param
)
if
len
(
tempList
)
<=
0
{
return
tempList
}
//过滤重复选项
dataList
:=
make
([]
*
vo2
.
SuggStubDetailVO
,
0
)
for
_
,
e
:=
range
tempList
{
for
_
,
e2
:=
range
dataList
{
if
strings
.
EqualFold
(
e
.
MatchId
,
e2
.
MatchId
)
{
continue
}
dataList
=
append
(
dataList
,
e
)
}
}
return
dataList
}
/**
###推送的主客队选项,
#格式为:时间:选项,时间:选项,时间:选项
...
...
@@ -59,4 +74,4 @@ func (this *LeisuService) teamOption() int {
}
}
return
result
}
\ No newline at end of file
}
foot-core/module/leisu/service/PubService.go
浏览文件 @
adfed63c
...
...
@@ -7,7 +7,7 @@ import (
"strconv"
"strings"
"tesou.io/platform/foot-parent/foot-api/common/base"
"tesou.io/platform/foot-parent/foot-api/module/analy
/vo"
vo3
"tesou.io/platform/foot-parent/foot-api/module/suggest
/vo"
"tesou.io/platform/foot-parent/foot-core/common/utils"
constants2
"tesou.io/platform/foot-parent/foot-core/module/leisu/constants"
utils2
"tesou.io/platform/foot-parent/foot-core/module/leisu/utils"
...
...
@@ -46,8 +46,8 @@ func (this *PubService) CycleTime() int64 {
*/
func
(
this
*
PubService
)
PubBJDC
()
{
//获取分析计算出的比赛列表
analy
List
:=
this
.
LeisuService
.
ListPubAbleData
()
if
len
(
analy
List
)
<
1
{
temp
List
:=
this
.
LeisuService
.
ListPubAbleData
()
if
len
(
temp
List
)
<
1
{
base
.
Log
.
Info
(
fmt
.
Sprintf
(
"1.当前没有可发布的比赛!!!!"
))
return
}
...
...
@@ -55,24 +55,24 @@ func (this *PubService) PubBJDC() {
//获取发布池的比赛列表
matchPool
:=
this
.
MatchPoolService
.
GetMatchList
()
//适配比赛,获取发布列表
pubList
:=
make
(
map
[
*
vo
.
AnalyResult
VO
]
*
vo2
.
MatchVO
,
0
)
for
_
,
analy
:=
range
analy
List
{
analy_mainTeam
:=
analy
.
MainTeamId
analy_guestTeam
:=
analy
.
GuestTeamId
pubList
:=
make
(
map
[
*
vo
3
.
SuggStubDetail
VO
]
*
vo2
.
MatchVO
,
0
)
for
_
,
temp
:=
range
temp
List
{
analy_mainTeam
:=
temp
.
MainTeam
analy_guestTeam
:=
temp
.
GuestTeam
for
_
,
match
:=
range
matchPool
{
if
strings
.
EqualFold
(
analy_mainTeam
,
match
.
MainTeam
)
{
pubList
[
analy
]
=
match
pubList
[
temp
]
=
match
break
;
}
if
strings
.
EqualFold
(
analy_guestTeam
,
match
.
GuestTeam
)
{
pubList
[
analy
]
=
match
pubList
[
temp
]
=
match
break
;
}
}
}
if
len
(
pubList
)
<=
0
{
base
.
Log
.
Info
(
fmt
.
Sprintf
(
"2.当前无可发布的比赛!!!!比赛池size:%d,分析赛果size:%d"
,
len
(
matchPool
),
len
(
analy
List
)))
base
.
Log
.
Info
(
fmt
.
Sprintf
(
"2.当前无可发布的比赛!!!!比赛池size:%d,分析赛果size:%d"
,
len
(
matchPool
),
len
(
temp
List
)))
return
}
//打印要发布的比赛
...
...
@@ -99,7 +99,7 @@ func (this *PubService) PubBJDC() {
case
0
,
100002
:
//0 成功 100002 每场比赛同一种玩法只可选择1次
analy
.
LeisuPubd
=
true
this
.
AnalyService
.
Modify
(
&
analy
.
AnalyResult
)
//
this.AnalyService.Modify(&analy.AnalyResult)
case
100003
:
//100003 标题长度不正确
default
:
...
...
foot-core/module/match/service/MatchLastService.go
浏览文件 @
adfed63c
...
...
@@ -82,7 +82,7 @@ FROM
foot.t_league l
WHERE la.LeagueId = l.Id
AND l.LevelAssist > 0
AND la.MatchDate > DATE_SUB(NOW(), INTERVAL
3
HOUR)
AND la.MatchDate > DATE_SUB(NOW(), INTERVAL
6
HOUR)
ORDER BY la.MatchDate ASC
`
//结果值
...
...
foot-core/module/spider/constants/Constant.go
浏览文件 @
adfed63c
package
constants
import
"time"
var
(
//数据爬取时间
SpiderDateStr
string
SpiderDateStr
=
time
.
Now
()
.
Format
(
"2006-01-02 15:04:05"
)
//全量数据爬取时间
FullSpiderDateStr
string
FullSpiderDateStr
=
time
.
Now
()
.
Format
(
"2006-01-02 15:04:05"
)
)
foot-core/module/suggest/service/SuggestService.go
浏览文件 @
adfed63c
...
...
@@ -66,11 +66,11 @@ WHERE mh.LeagueId = l.Id
sql
+=
" ORDER BY ar.MatchDate ASC, l.id ASC,mh.MainTeamId asc,ar.`AlFlag` DESC,ar.PreResult DESC "
}
//结果值
entitys
:=
make
([]
*
vo2
.
SuggStubVO
,
0
)
dataList
:=
make
([]
*
vo2
.
SuggStubVO
,
0
)
//执行查询
this
.
FindBySQL
(
sql
,
&
entitys
)
this
.
FindBySQL
(
sql
,
&
dataList
)
return
entitys
return
dataList
}
/**
...
...
@@ -204,14 +204,14 @@ WHERE mh.LeagueId = l.Id
}
//结果值
entitys
:=
make
([]
*
vo2
.
SuggStubDetailVO
,
0
)
dataList
:=
make
([]
*
vo2
.
SuggStubDetailVO
,
0
)
//执行查询
this
.
FindBySQL
(
sql
,
&
entitys
)
if
len
(
entitys
)
<=
0
{
return
entitys
this
.
FindBySQL
(
sql
,
&
dataList
)
if
len
(
dataList
)
<=
0
{
return
dataList
}
//for _, e := range
entitys
{
//for _, e := range
dataList
{
// matchId := e.MatchId
// eOddList := this.EuroLastService.FindByMatchId(matchId)
// aOddList := this.AsiaLastService.FindByMatchId(matchId)
...
...
@@ -220,7 +220,7 @@ WHERE mh.LeagueId = l.Id
// bffeList := this.BFFutureEventService.FindByMatchId(matchId)
//
//}
for
_
,
v
:=
range
entitys
{
for
_
,
v
:=
range
dataList
{
matchId
:=
v
.
MatchId
//积分,排名
bfsList
:=
this
.
BFScoreService
.
FindByMatchId
(
matchId
)
...
...
@@ -308,5 +308,146 @@ WHERE mh.LeagueId = l.Id
v
.
GuestNextMainTeam
=
bffe_guest
.
EventMainTeamId
}
}
return
entitys
return
dataList
}
func
(
this
*
SuggestService
)
QueryLeisu
(
param
*
vo2
.
SuggStubDetailVO
)
[]
*
vo2
.
SuggStubDetailVO
{
sql
:=
`
SELECT
l.Name AS LeagueName,
mh.MainTeamId AS MainTeam,
mh.GuestTeamId AS GuestTeam,
mh.MainTeamGoals AS MainTeamGoal,
mh.GuestTeamGoals AS GuestTeamGoal,
ar.*
FROM
foot.t_league l,
foot.t_match_his mh,
foot.t_analy_result ar,
(SELECT
ar1.MatchId
FROM
foot.t_analy_result ar1,
foot.t_analy_result ar2
WHERE ar1.MatchId = ar2.MatchId
AND ar1.AlFlag = 'E2'
AND ar2.AlFlag = 'C1'
AND ar1.PreResult = ar2.PreResult
) temp
WHERE mh.LeagueId = l.Id
AND mh.Id = ar.MatchId
AND ar.MatchId = temp.MatchId
AND ar.AlFlag IN ('E2' ,'C1')
`
if
len
(
param
.
BeginDateStr
)
>
0
{
sql
+=
" AND mh.`MatchDate` >= '"
+
param
.
BeginDateStr
+
"' "
}
if
len
(
param
.
EndDateStr
)
>
0
{
sql
+=
" AND mh.`MatchDate` <= '"
+
param
.
EndDateStr
+
"' "
}
if
param
.
IsDesc
{
sql
+=
" ORDER BY ar.MatchDate DESC, l.id ASC,mh.MainTeamId asc, ar.`AlFlag` DESC,ar.PreResult DESC "
}
else
{
sql
+=
" ORDER BY ar.MatchDate ASC, l.id ASC,mh.MainTeamId asc,ar.`AlFlag` DESC,ar.PreResult DESC "
}
//结果值
dataList
:=
make
([]
*
vo2
.
SuggStubDetailVO
,
0
)
//执行查询
this
.
FindBySQL
(
sql
,
&
dataList
)
if
len
(
dataList
)
<=
0
{
return
dataList
}
for
_
,
v
:=
range
dataList
{
matchId
:=
v
.
MatchId
//积分,排名
bfsList
:=
this
.
BFScoreService
.
FindByMatchId
(
matchId
)
if
len
(
bfsList
)
>
0
{
for
_
,
e
:=
range
bfsList
{
//bfs_arr有多语言版本,条数很多
if
e
.
TeamId
==
v
.
MainTeam
{
if
e
.
Type
==
"总"
{
v
.
BFSMainZong
=
e
}
if
e
.
Type
==
"主"
{
v
.
BFSMainZhu
=
e
}
if
e
.
Type
==
"近"
{
v
.
BFSMainJin
=
e
}
}
else
if
e
.
TeamId
==
v
.
GuestTeam
{
if
e
.
Type
==
"总"
{
v
.
BFSGuestZong
=
e
}
if
e
.
Type
==
"客"
{
v
.
BFSGuestKe
=
e
}
if
e
.
Type
==
"近"
{
v
.
BFSGuestJin
=
e
}
}
}
}
if
nil
==
v
.
BFSMainZong
{
v
.
BFSMainZong
=
new
(
pojo
.
BFScore
)
}
if
nil
==
v
.
BFSMainZhu
{
v
.
BFSMainZhu
=
new
(
pojo
.
BFScore
)
}
if
nil
==
v
.
BFSMainJin
{
v
.
BFSMainJin
=
new
(
pojo
.
BFScore
)
}
if
nil
==
v
.
BFSGuestZong
{
v
.
BFSGuestZong
=
new
(
pojo
.
BFScore
)
}
if
nil
==
v
.
BFSGuestKe
{
v
.
BFSGuestKe
=
new
(
pojo
.
BFScore
)
}
if
nil
==
v
.
BFSGuestJin
{
v
.
BFSGuestJin
=
new
(
pojo
.
BFScore
)
}
//过往战绩
bfbList
:=
this
.
BFBattleService
.
FindByMatchId
(
matchId
)
battleCount
:=
0
mainWin
:=
0
drawCount
:=
0
guestWin
:=
0
for
_
,
e
:=
range
bfbList
{
if
e
.
BattleMainTeamId
==
v
.
MainTeam
||
e
.
BattleMainTeamId
==
v
.
GuestTeam
{
battleCount
++
}
if
e
.
BattleMainTeamId
==
v
.
MainTeam
&&
e
.
BattleMainTeamGoals
>
e
.
BattleGuestTeamGoals
{
mainWin
++
}
if
e
.
BattleGuestTeamId
==
v
.
MainTeam
&&
e
.
BattleGuestTeamGoals
>
e
.
BattleMainTeamGoals
{
mainWin
++
}
if
e
.
BattleMainTeamId
==
v
.
GuestTeam
&&
e
.
BattleMainTeamGoals
>
e
.
BattleGuestTeamGoals
{
guestWin
++
}
if
e
.
BattleGuestTeamId
==
v
.
GuestTeam
&&
e
.
BattleGuestTeamGoals
>
e
.
BattleMainTeamGoals
{
guestWin
++
}
if
(
e
.
BattleMainTeamId
==
v
.
MainTeam
||
e
.
BattleMainTeamId
==
v
.
GuestTeam
)
&&
e
.
BattleMainTeamGoals
==
e
.
BattleGuestTeamGoals
{
drawCount
++
}
}
v
.
BattleCount
=
battleCount
v
.
BattleMainWinCount
=
mainWin
v
.
BattleDrawCount
=
drawCount
v
.
BattleGuestWinCount
=
guestWin
//未来赛事
bffe_main
:=
this
.
BFFutureEventService
.
FindNextBattle
(
matchId
,
v
.
MainTeam
)
if
nil
!=
bffe_main
{
v
.
MainNextMainTeam
=
bffe_main
.
EventMainTeamId
}
bffe_guest
:=
this
.
BFFutureEventService
.
FindNextBattle
(
matchId
,
v
.
GuestTeam
)
if
nil
!=
bffe_main
{
v
.
GuestNextMainTeam
=
bffe_guest
.
EventMainTeamId
}
}
return
dataList
}
\ No newline at end of file
foot-core/module/wechat/service/MessageService.go
浏览文件 @
adfed63c
...
...
@@ -23,7 +23,7 @@ func (this *MessageService) Today() []response.Article {
matchDateStr
:=
e
.
MatchDate
.
Format
(
"01月02日15点04分"
)
article
:=
response
.
Article
{}
article
.
Title
=
fmt
.
Sprintf
(
"%v"
,
matchDateStr
)
article
.
Description
=
fmt
.
Sprintf
(
"%v %v vs %v"
,
e
.
LeagueName
,
e
.
MainTeam
Id
,
e
.
GuestTeamId
)
article
.
Description
=
fmt
.
Sprintf
(
"%v %v vs %v"
,
e
.
LeagueName
,
e
.
MainTeam
,
e
.
GuestTeam
)
article
.
PicURL
=
"http://mmbiz.qpic.cn/sz_mmbiz_jpg/BePaFicK2B5QZuw0bf1HsiarnqQXzuWxE9XYC25oe2mVLeguvo6Rd1j1D2ibRibfmpu8eDqs0lfXaEfXR2bhslrPKQ/0?wx_fmt=jpeg"
article
.
URL
=
"https://gitee.com/aoe5188/foot-parent"
articles
[
i
]
=
article
...
...
foot-core/module/wechat/service/SuggestTodayService.go
浏览文件 @
adfed63c
...
...
@@ -440,7 +440,10 @@ func (this *SuggestTodayService) ModifyTodayA1(wcClient *core.Client) {
base
.
Log
.
Error
(
err
)
}
}
func
(
this
*
SuggestTodayService
)
Print11
(){
fmt
.
Println
(
constants
.
SpiderDateStr
)
fmt
.
Println
(
constants
.
FullSpiderDateStr
)
}
/**
今日待选池比赛
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录