Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang-queue-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
08a4df8b
authored
Jan 21, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
8176893b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
20210121_gorose_slow.log
special/activity_statistics/main.go
20210121_gorose_slow.log
View file @
08a4df8b
This diff is collapsed.
Click to expand it.
special/activity_statistics/main.go
View file @
08a4df8b
...
...
@@ -3,6 +3,7 @@ package main
import
(
"encoding/json"
"flag"
"fmt"
_
"github.com/go-sql-driver/mysql"
"github.com/gohouse/gorose/v2"
"github.com/ichunt2019/logger"
...
...
@@ -201,7 +202,9 @@ func main() {
logger
.
Error
(
err
.
Error
())
}
}
items
,
err
:=
db
.
Reset
()
.
Fields
(
"*,count(amount) as total_amount"
)
.
Table
(
"lie_order_activity_count"
)
.
items
,
err
:=
db
.
Reset
()
.
Fields
(
"activity_id,order_id,lie_user_main.user_id,mobile,create_device,sum(lie_order_activity_count.amount) as total_amount"
)
.
Table
(
"lie_order_activity_count"
)
.
LeftJoin
(
"lie_user_main on lie_order_activity_count.user_id = lie_user_main.user_id"
)
.
Where
(
"lie_order_activity_count.activity_id"
,
activity
.
Id
)
.
GroupBy
(
"order_id"
)
.
Get
()
...
...
@@ -222,6 +225,7 @@ func main() {
}
//存在跳过,不存在才插入
if
priceActivityMongo
.
OrderId
==
0
{
fmt
.
Println
(
result
)
priceActivityMongo
.
ActivityId
=
gjson
.
Get
(
result
,
"activity_id"
)
.
Int
()
priceActivityMongo
.
OrderId
=
gjson
.
Get
(
result
,
"order_id"
)
.
Int
()
priceActivityMongo
.
UserId
=
gjson
.
Get
(
result
,
"user_id"
)
.
Int
()
...
...
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