Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
加钱居士.
foot
提交
8403ee36
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 搜索 >>
提交
8403ee36
编写于
5月 19, 2020
作者:
M
monomania
提交者:
shi.zeyuan
5月 19, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.增加大小球,必发的数据库操作类
上级
66bcd79c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
190 addition
and
2 deletion
+190
-2
foot-core/module/odds/service/AsiaTrackService.go
foot-core/module/odds/service/AsiaTrackService.go
+1
-1
foot-core/module/odds/service/BetfairService.go
foot-core/module/odds/service/BetfairService.go
+35
-0
foot-core/module/odds/service/EuroTrackService.go
foot-core/module/odds/service/EuroTrackService.go
+1
-1
foot-core/module/odds/service/OverUnderHisService.go
foot-core/module/odds/service/OverUnderHisService.go
+99
-0
foot-core/module/odds/service/OverUnderLastService.go
foot-core/module/odds/service/OverUnderLastService.go
+54
-0
未找到文件。
foot-core/module/odds/service/AsiaTrackService.go
浏览文件 @
8403ee36
...
...
@@ -12,7 +12,7 @@ type AsiaTrackService struct {
}
func
(
this
*
AsiaTrackService
)
Exist
(
v
*
pojo
.
AsiaTrack
)
(
string
,
bool
)
{
temp
:=
&
pojo
.
AsiaTrack
{
MatchId
:
v
.
MatchId
,
CompId
:
v
.
CompId
,
OddDate
:
v
.
OddDate
}
temp
:=
&
pojo
.
AsiaTrack
{
MatchId
:
v
.
MatchId
,
CompId
:
v
.
CompId
,
OddDate
:
v
.
OddDate
,
Num
:
v
.
Num
}
var
id
string
exist
,
err
:=
mysql
.
GetEngine
()
.
Get
(
temp
)
if
err
!=
nil
{
...
...
foot-core/module/odds/service/BetfairService.go
0 → 100644
浏览文件 @
8403ee36
package
service
import
(
"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"
)
type
BetfairService
struct
{
mysql
.
BaseService
}
//查看数据是否已经存在
func
(
this
*
BetfairService
)
Exist
(
v
*
pojo
.
Betfair
)
(
string
,
bool
)
{
temp
:=
&
pojo
.
Betfair
{
MatchId
:
v
.
MatchId
,
Kind
:
v
.
Kind
}
var
id
string
exist
,
err
:=
mysql
.
GetEngine
()
.
Get
(
temp
)
if
err
!=
nil
{
base
.
Log
.
Error
(
"Exist:"
,
err
)
}
if
exist
{
id
=
temp
.
Id
}
return
id
,
exist
}
//根据比赛ID查找亚赔
func
(
this
*
BetfairService
)
FindByMatchId
(
matchId
string
)
[]
*
pojo
.
Betfair
{
dataList
:=
make
([]
*
pojo
.
Betfair
,
0
)
err
:=
mysql
.
GetEngine
()
.
Where
(
" MatchId = ? "
,
matchId
)
.
Find
(
dataList
)
if
err
!=
nil
{
base
.
Log
.
Error
(
"FindByMatchId:"
,
err
)
}
return
dataList
}
foot-core/module/odds/service/EuroTrackService.go
浏览文件 @
8403ee36
...
...
@@ -12,7 +12,7 @@ type EuroTrackService struct {
}
func
(
this
*
EuroTrackService
)
Exist
(
v
*
pojo
.
EuroTrack
)
(
string
,
bool
)
{
temp
:=
&
pojo
.
EuroTrack
{
MatchId
:
v
.
MatchId
,
CompId
:
v
.
CompId
,
OddDate
:
v
.
OddDate
}
temp
:=
&
pojo
.
EuroTrack
{
MatchId
:
v
.
MatchId
,
CompId
:
v
.
CompId
,
OddDate
:
v
.
OddDate
,
Num
:
v
.
Num
}
var
id
string
exist
,
err
:=
mysql
.
GetEngine
()
.
Get
(
temp
)
if
err
!=
nil
{
...
...
foot-core/module/odds/service/OverUnderHisService.go
0 → 100644
浏览文件 @
8403ee36
package
service
import
(
"strconv"
"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"
"tesou.io/platform/foot-parent/foot-core/module/analy/constants"
)
type
OverUnderHisService
struct
{
mysql
.
BaseService
}
func
(
this
*
OverUnderHisService
)
Exist
(
v
*
pojo
.
OverUnderHis
)
(
string
,
bool
)
{
sql_build
:=
strings
.
Builder
{}
sql_build
.
WriteString
(
" MatchId = '"
+
v
.
MatchId
+
"' AND CompId = '"
+
strconv
.
Itoa
(
v
.
CompId
)
+
"' "
)
temp
:=
&
pojo
.
OverUnderHis
{}
var
id
string
exist
,
err
:=
mysql
.
GetEngine
()
.
Where
(
sql_build
.
String
())
.
Get
(
temp
)
if
err
!=
nil
{
base
.
Log
.
Error
(
"Exist:"
,
err
)
}
if
exist
{
id
=
temp
.
Id
}
return
id
,
exist
}
//根据比赛ID查找亚赔
func
(
this
*
OverUnderHisService
)
FindByMatchId
(
matchId
string
)
[]
*
pojo
.
OverUnderHis
{
dataList
:=
make
([]
*
pojo
.
OverUnderHis
,
0
)
err
:=
mysql
.
GetEngine
()
.
Where
(
" MatchId = ? "
,
matchId
)
.
Find
(
&
dataList
)
if
err
!=
nil
{
base
.
Log
.
Error
(
"FindByMatchId:"
,
err
)
}
return
dataList
}
//根据比赛ID和波菜公司ID查找亚赔
func
(
this
*
OverUnderHisService
)
FindByMatchIdCompName
(
matchId
string
,
compNames
...
string
)
[]
*
pojo
.
OverUnderHis
{
dataList
:=
make
([]
*
pojo
.
OverUnderHis
,
0
)
sql_build
:=
strings
.
Builder
{}
if
len
(
compNames
)
>
0
&&
strings
.
EqualFold
(
compNames
[
0
],
constants
.
DEFAULT_REFER_ASIA
)
{
sql
:=
`
SELECT
h.*
FROM
t_asia_his h
WHERE 1 = 1
AND h.MatchId = '`
+
matchId
+
`'
AND h.PanKou =
(SELECT
t.PanKou
FROM
(SELECT
h.PanKou,
COUNT(1) AS cc
FROM
t_over_under_his h
WHERE h.MatchId = '`
+
matchId
+
`'
GROUP BY h.PanKou) t
ORDER BY t.cc DESC
LIMIT 0, 1)
AND h.EPanKou = (
(SELECT
t.EPanKou
FROM
(SELECT
h.EPanKou,
COUNT(1) AS cc
FROM
t_over_under_his h
WHERE h.MatchId = '`
+
matchId
+
`'
GROUP BY h.EPanKou) t
ORDER BY t.cc DESC
LIMIT 0, 1)
)
ORDER BY h.CompName ASC
`
//执行查询
this
.
FindBySQL
(
sql
,
&
dataList
)
}
else
{
sql_build
.
WriteString
(
" MatchId = '"
+
matchId
+
"' AND CompName in ( '0' "
)
for
_
,
v
:=
range
compNames
{
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
(
"FindByMatchIdCompName:"
,
err
)
}
}
return
dataList
}
foot-core/module/odds/service/OverUnderLastService.go
0 → 100644
浏览文件 @
8403ee36
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"
)
type
OverUnderLastService
struct
{
mysql
.
BaseService
}
//查看数据是否已经存在
func
(
this
*
OverUnderLastService
)
Exist
(
v
*
pojo
.
OverUnderLast
)
(
string
,
bool
)
{
temp
:=
&
pojo
.
OverUnderLast
{
MatchId
:
v
.
MatchId
,
CompId
:
v
.
CompId
}
var
id
string
exist
,
err
:=
mysql
.
GetEngine
()
.
Get
(
temp
)
if
err
!=
nil
{
base
.
Log
.
Error
(
"Exist:"
,
err
)
}
if
exist
{
id
=
temp
.
Id
}
return
id
,
exist
}
//根据比赛ID查找亚赔
func
(
this
*
OverUnderLastService
)
FindByMatchId
(
matchId
string
)
[]
*
pojo
.
OverUnderLast
{
dataList
:=
make
([]
*
pojo
.
OverUnderLast
,
0
)
err
:=
mysql
.
GetEngine
()
.
Where
(
" MatchId = ? "
,
matchId
)
.
Find
(
dataList
)
if
err
!=
nil
{
base
.
Log
.
Error
(
"FindByMatchId:"
,
err
)
}
return
dataList
}
//根据比赛ID和波菜公司ID查找亚赔
func
(
this
*
OverUnderLastService
)
FindByMatchIdCompName
(
matchId
string
,
compNames
...
string
)
[]
*
pojo
.
OverUnderLast
{
dataList
:=
make
([]
*
pojo
.
OverUnderLast
,
0
)
sql_build
:=
strings
.
Builder
{}
sql_build
.
WriteString
(
" MatchId = '"
+
matchId
+
"' AND CompName in ( '0' "
)
for
_
,
v
:=
range
compNames
{
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
(
"FindByMatchIdCompName:"
,
err
)
}
return
dataList
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录