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
16edbfeb
authored
Nov 20, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整竞调订单sale_id
parent
52dd3bec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
13 deletions
order/jingdiao/handle/handle.go
order/jingdiao/handle/sales.go
order/jingdiao/handle/handle.go
View file @
16edbfeb
...
...
@@ -111,21 +111,25 @@ func GetOrderAddress() JingdiaoAddress.JingdiaoAddress {
// 随机获取客服
func
GetSaleId
()
int
{
var
max_count
int
var
min_count
int
db
.
CmsDB
.
Get
(
&
max_count
,
"select Max(userId) from user_info where position_id = 62 and status = 0"
)
db
.
CmsDB
.
Get
(
&
min_count
,
"select Min(userId) from user_info where position_id = 62 and status = 0"
)
rand_num
:=
RandInt
(
min_count
-
1
,
max_count
+
1
)
// 从总数中取个随机数
var
sale_id
int
db
.
CmsDB
.
Get
(
&
sale_id
,
"select userId from user_info where userId = ? and position_id = ? and status = ?"
,
rand_num
,
62
,
0
)
//var max_count int
//var min_count int
//db.CmsDB.Get(&max_count, "select Max(userId) from user_info where position_id = 62 and status = 0")
//db.CmsDB.Get(&min_count, "select Min(userId) from user_info where position_id = 62 and status = 0")
//
//rand_num := RandInt(min_count - 1, max_count + 1) // 从总数中取个随机数
//
//var sale_id int
//db.CmsDB.Get(&sale_id, "select userId from user_info where userId = ? and position_id = ? and status = ?", rand_num, 62, 0)
//
//if sale_id == 0 {
// return GetSaleId()
//}
//
//return sale_id
if
sale_id
==
0
{
return
GetSaleId
()
}
rand_num
:=
RandInt
(
0
,
len
(
Sales
)
-
1
)
return
sale_id
return
Sales
[
rand_num
]
}
// 保留两位小数
...
...
order/jingdiao/handle/sales.go
0 → 100644
View file @
16edbfeb
package
handle
// 供竞调订单使用的销售人员ID
var
Sales
=
[]
int
{
1380
,
1381
,
1383
,
1384
,
1385
,
1387
,
1388
,
1389
,
1390
,
1391
,
1392
,
1394
,
1398
,
1399
,
1402
,
1404
,
1422
,
1440
,
1445
,
1448
,
1459
,
1461
,
1486
,
1491
,
1506
,
1528
,
1530
,
1533
,
1536
,
1537
,
1549
,
1554
,
1558
,
1560
,
1561
,
1564
,
1565
,
1568
,
1572
,
1579
,
1582
,
1585
,
1586
,
1595
,
1596
,
1601
,
1609
,
1610
,
1611
,
1618
,
1619
,
1621
,
1623
,
1626
,
1631
,
1634
,
1639
,
1642
,
1643
,
1644
,
1646
,
1651
,
1652
,
1657
,
1659
,
1660
,
1662
,
1663
,
1675
,
1676
,
1677
,
1679
,
1681
,
1687
,
1691
,
1698
,
1700
,
1706
,
1709
,
1712
,
1713
,
1714
,
1715
,
1719
,
1720
,
1721
,
1722
,
1725
,
1726
,
1727
,
}
\ No newline at end of file
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