Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
加钱居士.
foot
提交
27475c64
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 搜索 >>
提交
27475c64
编写于
2月 05, 2020
作者:
M
monomania
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.移除解析,增加稳胆
上级
2e1a98ec
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
229 addition
and
28 deletion
+229
-28
assets/wechat/html/today_guts.html
assets/wechat/html/today_guts.html
+62
-0
foot-core/module/suggest/service/SuggestService.go
foot-core/module/suggest/service/SuggestService.go
+52
-0
foot-core/module/wechat/service/MaterialService.go
foot-core/module/wechat/service/MaterialService.go
+1
-1
foot-core/module/wechat/service/SuggestTodayService.go
foot-core/module/wechat/service/SuggestTodayService.go
+77
-27
link_able_2.sql
link_able_2.sql
+37
-0
未找到文件。
assets/wechat/html/today_guts.html
0 → 100644
浏览文件 @
27475c64
<div>
<img
src=
"http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"
/>
</div>
<h1
style=
"color: red;font-weight: bold;font-size: 12px"
><strong>
注意
</strong></h1>
<ul
style=
"color: red;font-weight: bold;font-size: 12px"
>
<li><strong>
1.比赛为程序自动处理,自动更新同步,目前更新周期为60分钟一次,临场比赛(30分钟内开赛)为5分钟一次.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)2.获取最新推荐请点击"今日推荐"菜单按钮.
</strong></li>
<li><strong>
3.推荐的场次为当前时间"往前推96个小时"至"往后推24小时"的场次.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)4.推荐的场次会随指数的变化而变化(即时盘),如再次进入不见上次推荐的比赛,请查看"待选场次".
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)5.以下推荐的场次,当前己被模型认可.如后续被认可失败,则会下放到"待选场次"中.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.公众号主推模型为E2,请重点关注.
</strong></li>
<li><strong>
7.推荐选项跟着的字母,如A1 A2 E1 E2,为算法模型标识,仅是为了方便观察不同模型的表现.
</strong></li>
</ul>
<hr/>
<ul
style=
"font-size: 12px;font-weight: lighter"
>
<li><strong>
全量爬取时间:{{.FullSpiderDateStr}}
</strong></li>
<li><strong>
临场爬取时间:{{.SpiderDateStr}}
</strong></li>
<li><strong>
微信同步时间:{{.DataDateStr}}
</strong></li>
<li><strong>
日期:{{.BeginDateStr}} 至 {{.EndDateStr}}
</strong></li>
</ul>
<hr/>
<h1
style=
"margin-top: 5px"
>
<div
style=
"float: left;width: 40%"
><strong>
赛事列表
</strong></div>
<div
style=
"float: right;width: 40%;font-weight: bold;font-size: 12px"
>
模型:
</div>
</h1>
<table
style=
"font-size: 12px;font-weight: bold"
>
<tr>
<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>
{{.MatchDateStr}}
</td>
<td>
{{.LeagueName}}
</td>
<td>
{{.MainTeam}}({{.LetBall}}){{.GuestTeam}}
</td>
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
style=
"background-color: {{resultColor .Result}}"
>
{{preResultStr .PreResult .AlFlag}}
</td>
</tr>
{{end}}
{{end}}
{{else}}
<tr>
<td
colspan=
"7"
style=
"color: red;font-weight: bold;font-size: 12px"
>
暂时没有符合模型的比赛推荐,感谢关注~~~
</td>
</tr>
{{end}}
</table>
<span
style=
"color: red;font-weight: bold;font-size: 12px"
>
声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.
</span>
foot-core/module/suggest/service/SuggestService.go
浏览文件 @
27475c64
...
...
@@ -21,6 +21,58 @@ type SuggestService struct {
service2
.
BFFutureEventService
}
/**
查询待选池中的比赛
*/
func
(
this
*
SuggestService
)
QueryGuts
(
param
*
vo2
.
SuggStubVO
)
[]
*
vo2
.
SuggStubVO
{
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 "
}
//结果值
entitys
:=
make
([]
*
vo2
.
SuggStubVO
,
0
)
//执行查询
this
.
FindBySQL
(
sql
,
&
entitys
)
return
entitys
}
/**
查询待选池中的比赛
*/
...
...
foot-core/module/wechat/service/MaterialService.go
浏览文件 @
27475c64
...
...
@@ -15,7 +15,7 @@ func (this *MaterialService) ModifyNews(wcClient *core.Client) {
this
.
SuggestTodayService
.
ModifyTodayA1
(
wcClient
)
this
.
SuggestTodayService
.
ModifyTodayC1
(
wcClient
)
this
.
SuggestTodayService
.
ModifyToday
(
wcClient
)
this
.
SuggestTodayService
.
ModifyToday
DetailNew
(
wcClient
)
this
.
SuggestTodayService
.
ModifyToday
Guts
(
wcClient
)
this
.
SuggestWeekService
.
ModifyWeek
(
wcClient
)
this
.
SuggestMonthService
.
ModifyMonth
(
wcClient
)
...
...
foot-core/module/wechat/service/SuggestTodayService.go
浏览文件 @
27475c64
...
...
@@ -173,6 +173,7 @@ func (this *SuggestTodayService) ModifyToday(wcClient *core.Client) {
}
}
/**
今日赛事分析
*/
...
...
@@ -224,9 +225,72 @@ func (this *SuggestTodayService) ModifyTodayDetail(wcClient *core.Client) {
}
}
/**
今日赛事分析
*/
func
(
this
*
SuggestTodayService
)
ModifyTodayDetailNew
(
wcClient
*
core
.
Client
)
{
param
:=
new
(
vo
.
SuggStubDetailVO
)
now
:=
time
.
Now
()
h12
,
_
:=
time
.
ParseDuration
(
"-12h"
)
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"
)
//今日推荐
param
.
AlFlag
=
getAlFlag
()
tempList
:=
this
.
SuggestService
.
QueryDetail
(
param
)
//更新推送
first
:=
material
.
Article
{}
first
.
Title
=
fmt
.
Sprintf
(
"赛事解析-A1,C1,E2"
)
first
.
Digest
=
fmt
.
Sprintf
(
"赛事的模型算法解析"
)
first
.
ThumbMediaId
=
today_detail_thumbMediaId
first
.
ContentSourceURL
=
contentSourceURL
first
.
Author
=
utils
.
GetVal
(
"wechat"
,
"author"
)
temp
:=
vo
.
TTodayDetailVO
{}
temp
.
SpiderDateStr
=
constants
.
SpiderDateStr
temp
.
FullSpiderDateStr
=
constants
.
FullSpiderDateStr
temp
.
BeginDateStr
=
param
.
BeginDateStr
temp
.
EndDateStr
=
param
.
EndDateStr
temp
.
DataDateStr
=
now
.
Format
(
"2006-01-02 15:04:05"
)
temp
.
DataList
=
make
([]
vo
.
SuggStubDetailVO
,
len
(
tempList
))
for
i
,
e
:=
range
tempList
{
e
.
MatchDateStr
=
e
.
MatchDate
.
Format
(
"02号15:04"
)
temp
.
DataList
[
i
]
=
*
e
}
teplate_paths
:=
[]
string
{
"assets/wechat/html/today_detail_new.html"
,
"assets/common/template/analycontent/001.html"
,
"assets/common/template/analycontent/002.html"
,
"assets/common/template/analycontent/004.html"
,
"assets/common/template/analycontent/005.html"
,
"assets/common/template/analycontent/footer.html"
,
"assets/common/template/analycontent/wechat_today_detail_new.html"
,
}
var
buf
bytes
.
Buffer
tpl
,
err
:=
template
.
New
(
"today_detail_new.html"
)
.
Funcs
(
getFuncMap
())
.
ParseFiles
(
teplate_paths
...
)
//tpl, err := template.New("wechat_today_detail_new.html").Funcs(getFuncMap()).ParseFiles("assets/common/template/wechat_today_detail_new.html")
if
err
!=
nil
{
base
.
Log
.
Error
(
err
)
}
if
err
:=
tpl
.
Execute
(
&
buf
,
&
temp
);
err
!=
nil
{
base
.
Log
.
Fatal
(
err
)
}
first
.
Content
=
buf
.
String
()
first
.
Content
=
strings
.
TrimSpace
(
first
.
Content
)
first
.
Content
=
strings
.
ReplaceAll
(
first
.
Content
,
"
\r\n
"
,
""
)
err
=
material
.
UpdateNews
(
wcClient
,
today_mediaId
,
2
,
&
first
)
if
err
!=
nil
{
base
.
Log
.
Error
(
err
)
}
}
/**
今日C1
待选池
比赛
今日C1比赛
*/
func
(
this
*
SuggestTodayService
)
ModifyTodayC1
(
wcClient
*
core
.
Client
)
{
param
:=
new
(
vo
.
SuggStubVO
)
...
...
@@ -276,54 +340,42 @@ func (this *SuggestTodayService) ModifyTodayC1(wcClient *core.Client) {
}
/**
今日
赛事分析
今日
稳胆比赛
*/
func
(
this
*
SuggestTodayService
)
ModifyToday
DetailNew
(
wcClient
*
core
.
Client
)
{
param
:=
new
(
vo
.
SuggStub
Detail
VO
)
func
(
this
*
SuggestTodayService
)
ModifyToday
Guts
(
wcClient
*
core
.
Client
)
{
param
:=
new
(
vo
.
SuggStubVO
)
now
:=
time
.
Now
()
h12
,
_
:=
time
.
ParseDuration
(
"-
12
h"
)
h12
,
_
:=
time
.
ParseDuration
(
"-
96
h"
)
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"
)
//今日推荐
param
.
AlFlag
=
getAlFlag
()
tempList
:=
this
.
SuggestService
.
QueryDetail
(
param
)
tempList
:=
this
.
SuggestService
.
QueryGuts
(
param
)
//更新推送
first
:=
material
.
Article
{}
first
.
Title
=
fmt
.
Sprintf
(
"
赛事解析-A1,
C1,E2"
)
first
.
Digest
=
fmt
.
Sprintf
(
"
赛事的模型算法解析"
)
first
.
ThumbMediaId
=
today_
detail
_thumbMediaId
first
.
Title
=
fmt
.
Sprintf
(
"
稳胆场次-
C1,E2"
)
first
.
Digest
=
fmt
.
Sprintf
(
"
%d场赛事"
,
len
(
tempList
)
)
first
.
ThumbMediaId
=
today_
c1
_thumbMediaId
first
.
ContentSourceURL
=
contentSourceURL
first
.
Author
=
utils
.
GetVal
(
"wechat"
,
"author"
)
temp
:=
vo
.
TToday
Detail
VO
{}
temp
:=
vo
.
TTodayVO
{}
temp
.
SpiderDateStr
=
constants
.
SpiderDateStr
temp
.
FullSpiderDateStr
=
constants
.
FullSpiderDateStr
temp
.
BeginDateStr
=
param
.
BeginDateStr
temp
.
EndDateStr
=
param
.
EndDateStr
temp
.
DataDateStr
=
now
.
Format
(
"2006-01-02 15:04:05"
)
temp
.
DataList
=
make
([]
vo
.
SuggStub
Detail
VO
,
len
(
tempList
))
temp
.
DataList
=
make
([]
vo
.
SuggStubVO
,
len
(
tempList
))
for
i
,
e
:=
range
tempList
{
e
.
MatchDateStr
=
e
.
MatchDate
.
Format
(
"02号15:04"
)
temp
.
DataList
[
i
]
=
*
e
}
teplate_paths
:=
[]
string
{
"assets/wechat/html/today_detail_new.html"
,
"assets/common/template/analycontent/001.html"
,
"assets/common/template/analycontent/002.html"
,
"assets/common/template/analycontent/004.html"
,
"assets/common/template/analycontent/005.html"
,
"assets/common/template/analycontent/footer.html"
,
"assets/common/template/analycontent/wechat_today_detail_new.html"
,
}
var
buf
bytes
.
Buffer
tpl
,
err
:=
template
.
New
(
"today_detail_new.html"
)
.
Funcs
(
getFuncMap
())
.
ParseFiles
(
teplate_paths
...
)
//tpl, err := template.New("wechat_today_detail_new.html").Funcs(getFuncMap()).ParseFiles("assets/common/template/wechat_today_detail_new.html")
tpl
,
err
:=
template
.
New
(
"today_guts.html"
)
.
Funcs
(
getFuncMap
())
.
ParseFiles
(
"assets/wechat/html/today_guts.html"
)
if
err
!=
nil
{
base
.
Log
.
Error
(
err
)
}
...
...
@@ -331,8 +383,6 @@ func (this *SuggestTodayService) ModifyTodayDetailNew(wcClient *core.Client) {
base
.
Log
.
Fatal
(
err
)
}
first
.
Content
=
buf
.
String
()
first
.
Content
=
strings
.
TrimSpace
(
first
.
Content
)
first
.
Content
=
strings
.
ReplaceAll
(
first
.
Content
,
"
\r\n
"
,
""
)
err
=
material
.
UpdateNews
(
wcClient
,
today_mediaId
,
2
,
&
first
)
if
err
!=
nil
{
...
...
link_able_2.sql
0 → 100644
浏览文件 @
27475c64
SELECT
ar
.
`MatchDate`
,
ar
.
`AlFlag`
,
ar
.
`PreResult`
,
ar
.
`Result`
,
ar
.
`HitCount`
,
l
.
Name
AS
LeagueName
,
mh
.
MainTeamId
AS
MainTeam
,
mh
.
GuestTeamId
AS
GuestTeam
,
mh
.
MainTeamGoals
AS
MainTeamGoal
,
mh
.
GuestTeamGoals
AS
GuestTeamGoal
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`
AND
ar1
.
`HitCount`
>
0
AND
ar2
.
`HitCount`
>
0
)
temp
WHERE
mh
.
LeagueId
=
l
.
Id
AND
mh
.
Id
=
ar
.
MatchId
AND
ar
.
`MatchId`
=
temp
.
MatchId
AND
ar
.
`AlFlag`
IN
(
'E2'
,
'C1'
)
ORDER
BY
ar
.
MatchDate
DESC
,
l
.
id
ASC
,
mh
.
MainTeamId
ASC
,
ar
.
`AlFlag`
DESC
,
ar
.
`PreResult`
DESC
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录