提交 27475c64 编写于 作者: M monomania

1.移除解析,增加稳胆

上级 2e1a98ec
<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>
......@@ -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
}
/**
查询待选池中的比赛
*/
......
......@@ -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.ModifyTodayDetailNew(wcClient)
this.SuggestTodayService.ModifyTodayGuts(wcClient)
this.SuggestWeekService.ModifyWeek(wcClient)
this.SuggestMonthService.ModifyMonth(wcClient)
......
......@@ -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) ModifyTodayDetailNew(wcClient *core.Client) {
param := new(vo.SuggStubDetailVO)
func (this *SuggestTodayService) ModifyTodayGuts(wcClient *core.Client) {
param := new(vo.SuggStubVO)
now := time.Now()
h12, _ := time.ParseDuration("-12h")
h12, _ := time.ParseDuration("-96h")
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.TTodayDetailVO{}
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.SuggStubDetailVO, 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 {
......
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.
先完成此消息的编辑!
想要评论请 注册