Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoyanbin
nbya
Commits
783f43c8
Commit
783f43c8
authored
3 years ago
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
countMatch
parent
5e1f8965
master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
27 deletions
+3
-27
org_player.go
app/mobile/service/dto/org_player.go
+1
-17
org_player.go
app/mobile/service/org_player.go
+2
-10
No files found.
app/mobile/service/dto/org_player.go
View file @
783f43c8
...
@@ -79,28 +79,12 @@ type OrgPlayerGetInfoReply struct {
...
@@ -79,28 +79,12 @@ type OrgPlayerGetInfoReply struct {
RoundsScoring
[]
OrgPlayerRoundsScoring
`json:"roundsScoring"`
RoundsScoring
[]
OrgPlayerRoundsScoring
`json:"roundsScoring"`
}
}
type
DataAvg
struct
{
//ScoringAvg string `json:"scoringAvg" comment:"得分"`
//ReboundAvg string `json:"reboundAvg" comment:"篮板"`
//AssistAvg string `json:"assistAvg" comment:"助攻"`
//StealAvg string `json:"stealAvg" comment:"抢断"`
//FreeThrowAvg string `json:"freeThrowAvg" comment:"罚球"`
//BlockShotAvg string `json:"blockShotAvg" comment:"盖帽"`
//FoulAvg string `json:"foulAvg" comment:"犯规"`
//TwoPointShotAvg string `json:"twoPointShotAvg" comment:"2分进球数量"`
//ThreePointShotAvg string `json:"threePointShotAvg" comment:"3分进球数量"`
Scoring
string
`json:"scoring" comment:"得分"`
Rebound
string
`json:"rebound" comment:"篮板"`
Assist
string
`json:"assist" comment:"助攻"`
Steal
string
`json:"steal" comment:"抢断"`
BlockShot
string
`json:"blockShot" comment:"盖帽"`
}
type
OrgMatchInfo
struct
{
type
OrgMatchInfo
struct
{
Id
string
`json:"id"`
Id
string
`json:"id"`
SeasonId
string
`json:"seasonId" comment:"赛季id"`
SeasonId
string
`json:"seasonId" comment:"赛季id"`
SeasonName
string
`json:"seasonName" comment:"赛季名称"`
SeasonName
string
`json:"seasonName" comment:"赛季名称"`
LeagueName
string
`json:"leagueName" comment:"联赛级别"`
LeagueName
string
`json:"leagueName" comment:"联赛级别"`
CountMatch
string
`json:"countMatch" comment:"场次"`
dto
.
TotalScoring
dto
.
TotalScoring
}
}
...
...
This diff is collapsed.
Click to expand it.
app/mobile/service/org_player.go
View file @
783f43c8
...
@@ -165,7 +165,7 @@ func (e *OrgPlayer) StatisticsScoringAvg(playerId string, seasonId string, stati
...
@@ -165,7 +165,7 @@ func (e *OrgPlayer) StatisticsScoringAvg(playerId string, seasonId string, stati
var
err
error
var
err
error
field
:=
""
field
:=
""
field
+=
"omtp.id, ol.league_name, os.season_name, om.season_id,"
+
field
+=
"omtp.id, ol.league_name, os.season_name, om.season_id,
count(omtp.id)as count_match,
"
+
"sum(omtp.scoring)as scoring,"
+
"sum(omtp.scoring)as scoring,"
+
"sum(omtp.rebound)as rebound,"
+
"sum(omtp.rebound)as rebound,"
+
"sum(omtp.assist)as assist,"
+
"sum(omtp.assist)as assist,"
+
...
@@ -187,15 +187,7 @@ func (e *OrgPlayer) StatisticsScoringAvg(playerId string, seasonId string, stati
...
@@ -187,15 +187,7 @@ func (e *OrgPlayer) StatisticsScoringAvg(playerId string, seasonId string, stati
First
(
data
)
.
Error
First
(
data
)
.
Error
if
statistics
==
"avg"
{
if
statistics
==
"avg"
{
var
teamCount
int64
=
0
teamCount
,
_
:=
strconv
.
ParseInt
(
data
.
CountMatch
,
10
,
64
)
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id and omtp.rounds = om.rounds"
)
.
Select
(
field
)
.
Scopes
(
cDto
.
SetWhere
(
"om"
,
"season_id"
,
seasonId
),
cDto
.
SetWhere
(
"omtp"
,
"player_id"
,
playerId
),
)
.
Count
(
&
teamCount
)
.
Error
data
.
Scoring
=
utils
.
GetAvg
(
data
.
Scoring
,
teamCount
)
data
.
Scoring
=
utils
.
GetAvg
(
data
.
Scoring
,
teamCount
)
data
.
Rebound
=
utils
.
GetAvg
(
data
.
Rebound
,
teamCount
)
data
.
Rebound
=
utils
.
GetAvg
(
data
.
Rebound
,
teamCount
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment