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
db40f333
authored
Nov 19, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整竞调用户、推送客服
parent
9b78daed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
dal/order/JingdiaoAddress/JingdiaoAddress.go
order/jingdiao/handle/handle.go
order/jingdiao/main.go
dal/order/JingdiaoAddress/JingdiaoAddress.go
View file @
db40f333
...
...
@@ -5,5 +5,6 @@ type JingdiaoAddress struct {
Company
string
`db:"company"`
Lianxiren
string
`db:"lianxiren"`
Address
string
`db:"address"`
UserId
int
`db:"user_id"`
Telphone
string
`db:"telphone"`
}
order/jingdiao/handle/handle.go
View file @
db40f333
...
...
@@ -81,7 +81,7 @@ func GetOrderAddress() JingdiaoAddress.JingdiaoAddress {
rand_num
:=
RandInt
(
1
,
count
+
1
)
// 从总数中取个随机数
var
address
JingdiaoAddress
.
JingdiaoAddress
db
.
DB
.
Get
(
&
address
,
"select id, company, lianxiren, address,
telphone from lie_jingdiao_address where id = ?
"
,
rand_num
)
db
.
DB
.
Get
(
&
address
,
"select id, company, lianxiren, address,
user_id, telphone from lie_jingdiao_address where id = ? and user_id != 0
"
,
rand_num
)
if
address
.
Id
==
0
{
return
GetOrderAddress
()
...
...
order/jingdiao/main.go
View file @
db40f333
...
...
@@ -69,8 +69,8 @@ func main() {
// 创建订单
for
i
:=
0
;
i
<
order_count
;
i
++
{
var
user_id
int
=
handle
.
GetJingDiaoUserId
()
go
CreateOrder
(
user_id
,
start_time
)
//
var user_id int = handle.GetJingDiaoUserId()
go
CreateOrder
(
start_time
)
}
start_time
+=
86400
...
...
@@ -89,8 +89,8 @@ func main() {
// 创建订单
for
i
:=
0
;
i
<
order_count
;
i
++
{
var
user_id
int
=
handle
.
GetJingDiaoUserId
()
go
CreateOrder
(
user_id
,
start_time
)
//
var user_id int = handle.GetJingDiaoUserId()
go
CreateOrder
(
start_time
)
}
<-
forever
...
...
@@ -105,26 +105,28 @@ func main() {
Order
.
UpdateJingDiaoOrder
()
// 创建订单
for
i
:=
0
;
i
<
order_count
;
i
++
{
var
user_id
int
=
handle
.
GetJingDiaoUserId
()
CreateOrder
(
user_id
,
time
.
Now
()
.
Unix
())
for
i
:=
0
;
i
<
1
;
i
++
{
//
var user_id int = handle.GetJingDiaoUserId()
CreateOrder
(
time
.
Now
()
.
Unix
())
}
}
}
// 创建订单
func
CreateOrder
(
user_id
int
,
create_time
int64
)
{
func
CreateOrder
(
create_time
int64
)
{
var
min_amount
int
// 订单总额不低于随机生成数
var
order_item
OrderItems
.
OrderItems
// 随机获取一条明细
var
order_address
JingdiaoAddress
.
JingdiaoAddress
// 随机获取一条地址
var
goods_number
int
// 商品数量
var
order_sn
string
// 订单号
var
order_amount
float64
// 订单总额
var
user_id
int
min_amount
=
handle
.
RandInt
(
8000
,
15000
)
/
100
*
100
order_item
=
handle
.
GetOneOrderItem
()
order_address
=
handle
.
GetOrderAddress
()
user_id
=
order_address
.
UserId
goods_number
=
int
(
float64
(
min_amount
)
/
order_item
.
GoodsPrice
)
order_amount
=
handle
.
Decimal
(
order_item
.
GoodsPrice
*
float64
(
goods_number
))
...
...
@@ -138,8 +140,8 @@ func CreateOrder(user_id int, create_time int64) {
order
[
"user_id"
]
=
user_id
order
[
"order_amount"
]
=
order_amount
order
[
"status"
]
=
4
//
order["sale_id"] = handle.GetSaleId()
order
[
"sale_id"
]
=
1434
// 默认推送给张婷玉
order
[
"sale_id"
]
=
handle
.
GetSaleId
()
//
order["sale_id"] = 1434 // 默认推送给张婷玉
order
[
"is_type"
]
=
1
goods_data
[
"user_id"
]
=
user_id
...
...
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