diff --git a/assets/leisu/html/content.html b/assets/leisu/html/content.html
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9bb61350f3a584225382b8f133198b5d92f2c68d 100644
--- a/assets/leisu/html/content.html
+++ b/assets/leisu/html/content.html
@@ -0,0 +1,5 @@
+基本面:
+主队总场,积{{.Score}}分,排名:{{.Ranking}},胜率:{{.WinRate}}%
+主队主场,积{{.Score}}分,排名:{{.Ranking}},胜率:{{.WinRate}}%
+客队总场,积{{.Score}}分,排名:{{.Ranking}},胜率:{{.WinRate}}%
+客队客场,积{{.Score}}分,排名:{{.Ranking}},胜率:{{.WinRate}}%
diff --git a/foot-api/module/suggest/pojo/Suggest.go b/foot-api/module/suggest/pojo/Suggest.go
index bfa285b8ec3ff61cf1a5a2895e50ba7930ea20e4..0814d3d4640b2016865b73cb33ad4c4d82b2affe 100644
--- a/foot-api/module/suggest/pojo/Suggest.go
+++ b/foot-api/module/suggest/pojo/Suggest.go
@@ -11,7 +11,5 @@ import (
*/
type Suggest struct {
-
-
pojo2.AnalyResult `xorm:"extends"`
}
diff --git a/foot-api/module/suggest/vo/SuggestDetailVO.go b/foot-api/module/suggest/vo/SuggestDetailVO.go
new file mode 100644
index 0000000000000000000000000000000000000000..47f0268ae7f3e940d3e8912915fc7bc59977957f
--- /dev/null
+++ b/foot-api/module/suggest/vo/SuggestDetailVO.go
@@ -0,0 +1,46 @@
+package vo
+
+import (
+ pojo3 "tesou.io/platform/foot-parent/foot-api/module/match/pojo"
+ pojo2 "tesou.io/platform/foot-parent/foot-api/module/odds/pojo"
+ "tesou.io/platform/foot-parent/foot-api/module/suggest/pojo"
+)
+
+type SuggestDetailVO struct {
+ MatchDateStr string
+ //联赛
+ LeagueName string
+ //主队
+ MainTeam string
+ //客队
+ GuestTeam string
+ //主队进球
+ MainTeamGoal string
+ //客队进球
+ GuestTeamGoal string
+ //指数
+ HitCount int
+ //开始时间
+ BeginDateStr string
+ //结束时间
+ EndDateStr string
+ //是否倒序
+ IsDesc bool
+ //算法标识
+ AlFlags []string
+
+ pojo.Suggest `xorm:"extends"`
+
+ //欧赔
+ EOddList []*pojo2.EuroLast
+ //亚赔
+ AOddList []*pojo2.AsiaLast
+
+ //基本面
+ BFSList []*pojo3.BFScore
+ BFBList []*pojo3.BFBattle
+ BFFEList []*pojo3.BFFutureEvent
+
+
+
+}
diff --git a/foot-api/module/suggest/vo/TodayDetailVO.go b/foot-api/module/suggest/vo/TodayDetailVO.go
new file mode 100644
index 0000000000000000000000000000000000000000..deab2b1d5eaa959baf792b8eeba7be005857bf8b
--- /dev/null
+++ b/foot-api/module/suggest/vo/TodayDetailVO.go
@@ -0,0 +1,14 @@
+package vo
+
+type TodayDetailVO struct {
+ SpiderDateStr string
+ //开始时间
+ BeginDateStr string
+ //结束时间
+ EndDateStr string
+ //数据时间
+ DataDateStr string
+
+ DataList []SuggestDetailVO
+
+}
diff --git a/foot-api/module/suggest/vo/TodayVO.go b/foot-api/module/suggest/vo/TodayVO.go
index d34de9b55163348a00cbd3aeaeafb338f192861a..5af43fb354ff8d1eeac6a83e7ffdeb95854b7fe7 100644
--- a/foot-api/module/suggest/vo/TodayVO.go
+++ b/foot-api/module/suggest/vo/TodayVO.go
@@ -1,7 +1,5 @@
package vo
-import "tesou.io/platform/foot-parent/foot-api/module/odds/pojo"
-
type TodayVO struct {
SpiderDateStr string
//开始时间
@@ -12,8 +10,4 @@ type TodayVO struct {
DataDateStr string
DataList []SuggestVO
-
- EuroOddList []pojo.EuroLast
-
- AsiaOddList []pojo.AsiaLast
}
diff --git a/foot-core/module/odds/service/EuroLastService.go b/foot-core/module/odds/service/EuroLastService.go
index 61c298152e4b3c0bcc525757eb656beba4bc35d8..4d30dcf4e3c448556cd8da8aa5fbf0017d377a72 100644
--- a/foot-core/module/odds/service/EuroLastService.go
+++ b/foot-core/module/odds/service/EuroLastService.go
@@ -21,9 +21,9 @@ func (this *EuroLastService) FindExists(v *pojo.EuroLast) bool {
}
//根据比赛ID查找欧赔
-func (this *EuroLastService) FindByMatchId(v *pojo.EuroLast) []*pojo.EuroLast {
+func (this *EuroLastService) FindByMatchId(matchId string) []*pojo.EuroLast {
dataList := make([]*pojo.EuroLast, 0)
- err := mysql.GetEngine().Where(" MatchId = ? ", v.MatchId).Find(dataList)
+ err := mysql.GetEngine().Where(" MatchId = ? ",matchId).Find(dataList)
if err != nil {
base.Log.Error("FindByMatchId:", err)
}
diff --git a/foot-core/module/suggest/service/SuggestService.go b/foot-core/module/suggest/service/SuggestService.go
index 6f9097e2b4fa39799f0060053c3249f54415bba8..de3acc201fa210a7133883d8773bf999e02067b3 100644
--- a/foot-core/module/suggest/service/SuggestService.go
+++ b/foot-core/module/suggest/service/SuggestService.go
@@ -4,6 +4,8 @@ import (
"strconv"
vo2 "tesou.io/platform/foot-parent/foot-api/module/suggest/vo"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
+ service2 "tesou.io/platform/foot-parent/foot-core/module/match/service"
+ "tesou.io/platform/foot-parent/foot-core/module/odds/service"
)
/**
@@ -11,6 +13,11 @@ import (
*/
type SuggestService struct {
mysql.BaseService
+ service.EuroLastService
+ service.AsiaLastService
+ service2.BFScoreService
+ service2.BFBattleService
+ service2.BFFutureEventService
}
/**
@@ -57,7 +64,6 @@ WHERE mh.LeagueId = l.Id
this.FindBySQL(sql, &entitys)
return entitys
-
}
func (this *SuggestService) Query(param *vo2.SuggestVO) []*vo2.SuggestVO {
@@ -103,5 +109,68 @@ WHERE mh.LeagueId = l.Id
this.FindBySQL(sql, &entitys)
return entitys
+}
+
+func (this *SuggestService) QueryDetail(param *vo2.SuggestDetailVO) []*vo2.SuggestDetailVO {
+ 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
+WHERE mh.LeagueId = l.Id
+ AND mh.Id = ar.MatchId
+ AND ar.HitCount > 0
+ AND ar.HitCount >= ar.THitCount
+ `
+ if param.HitCount > 0 {
+ sql += " AND ar.HitCount >= '" + strconv.Itoa(param.HitCount) + "' "
+ }
+
+ if len(param.AlFlag) > 0 {
+ sql += " AND ar.AlFlag in (" + param.AlFlag + ") "
+ }
+ 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.`AlFlag` DESC,ar.MatchDate DESC, l.id ASC,mh.MainTeamId asc, ar.PreResult DESC "
+ } else {
+ sql += " ORDER BY ar.`AlFlag` DESC,ar.MatchDate ASC, l.id ASC,mh.MainTeamId asc,ar.PreResult DESC "
+ }
+
+ //结果值
+ entitys := make([]*vo2.SuggestDetailVO, 0)
+ //执行查询
+ this.FindBySQL(sql, &entitys)
+ if len(entitys) <= 0 {
+ return entitys
+ }
+
+ for _, e := range entitys {
+ matchId := e.MatchId
+ eOddList := this.EuroLastService.FindByMatchId(matchId)
+ aOddList := this.AsiaLastService.FindByMatchId(matchId)
+ bfsList := this.BFScoreService.FindByMatchId(matchId)
+ bfbList := this.BFBattleService.FindByMatchId(matchId)
+ bffeList := this.BFFutureEventService.FindByMatchId(matchId)
+ e.EOddList = eOddList
+ e.AOddList = aOddList
+ e.BFSList = bfsList
+ e.BFBList = bfbList
+ e.BFFEList = bffeList
+ }
+
+ return entitys
}
diff --git a/foot-core/module/wechat/service/SuggestTodayService.go b/foot-core/module/wechat/service/SuggestTodayService.go
index 2bfd2c6e08c61cc4c35bfe5aebfead912caba267..6692f02abd0db6da1adb8e64ab2c78eee059c98d 100644
--- a/foot-core/module/wechat/service/SuggestTodayService.go
+++ b/foot-core/module/wechat/service/SuggestTodayService.go
@@ -161,7 +161,7 @@ func (this *SuggestTodayService) ModifyToday(wcClient *core.Client) {
今日赛事分析
*/
func (this *SuggestTodayService) ModifyTodayDetail(wcClient *core.Client) {
- param := new(vo.SuggestVO)
+ param := new(vo.SuggestDetailVO)
now := time.Now()
h12, _ := time.ParseDuration("-24h")
beginDate := now.Add(h12)
@@ -171,7 +171,7 @@ func (this *SuggestTodayService) ModifyTodayDetail(wcClient *core.Client) {
param.EndDateStr = endDate.Format("2006-01-02 15:04:05")
//今日推荐
param.AlFlag = getAlFlag()
- tempList := this.SuggestService.Query(param)
+ tempList := this.SuggestService.QueryDetail(param)
//更新推送
first := material.Article{}
first.Title = fmt.Sprintf("赛事解析")
@@ -180,12 +180,12 @@ func (this *SuggestTodayService) ModifyTodayDetail(wcClient *core.Client) {
first.ContentSourceURL = contentSourceURL
first.Author = utils.GetVal("wechat", "author")
- temp := vo.TodayVO{}
+ temp := vo.TodayDetailVO{}
temp.SpiderDateStr = constants.SpiderDateStr
temp.BeginDateStr = param.BeginDateStr
temp.EndDateStr = param.EndDateStr
temp.DataDateStr = now.Format("2006-01-02 15:04:05")
- temp.DataList = make([]vo.SuggestVO, len(tempList))
+ temp.DataList = make([]vo.SuggestDetailVO, len(tempList))
for i, e := range tempList {
e.MatchDateStr = e.MatchDate.Format("02号15:04")
temp.DataList[i] = *e