Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-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
a6efa346
authored
Dec 31, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
判断sql插入限制
parent
5169c749
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
internal/dao/com_basicinfos.go
internal/dao/com_credits.go
internal/logic/mobile_message.go
internal/dao/com_basicinfos.go
View file @
a6efa346
...
@@ -37,7 +37,6 @@ func (d *dao) GetCompanyBaseInfoByCid(c context.Context, companyId int64) (res m
...
@@ -37,7 +37,6 @@ func (d *dao) GetCompanyBaseInfoByCid(c context.Context, companyId int64) (res m
tycInfo
:=
logic
.
HttpGet
(
res
[
"com_name"
])
tycInfo
:=
logic
.
HttpGet
(
res
[
"com_name"
])
tycInfo
[
"com_credits_id"
]
=
res
[
"com_credits_id"
]
tycInfo
[
"com_credits_id"
]
=
res
[
"com_credits_id"
]
tycInfo
[
"tyc_select_num"
]
=
"1"
tycInfo
[
"tyc_select_num"
]
=
"1"
fmt
.
Println
(
tycInfo
)
d
.
UpdateCompanyBaseInfoForTyc
(
c
,
tycInfo
)
d
.
UpdateCompanyBaseInfoForTyc
(
c
,
tycInfo
)
logic
.
SendMessage
(
logic
.
StringTurnInt64
(
res
[
"legal_mobile_phone"
]),
""
)
logic
.
SendMessage
(
logic
.
StringTurnInt64
(
res
[
"legal_mobile_phone"
]),
""
)
}
}
...
...
internal/dao/com_credits.go
View file @
a6efa346
...
@@ -15,7 +15,7 @@ func (d *dao) GetCompanyCresitsList(ctx context.Context) (res []map[string]strin
...
@@ -15,7 +15,7 @@ func (d *dao) GetCompanyCresitsList(ctx context.Context) (res []map[string]strin
var
(
var
(
rows
*
sql
.
Rows
rows
*
sql
.
Rows
)
)
if
rows
,
err
=
d
.
db
.
Query
(
ctx
,
"SELECT "
+
SqlField
+
" FROM lie_com_credits where id >
4907
"
);
err
!=
nil
{
if
rows
,
err
=
d
.
db
.
Query
(
ctx
,
"SELECT "
+
SqlField
+
" FROM lie_com_credits where id >
5022
"
);
err
!=
nil
{
err
=
errors
.
WithStack
(
err
)
err
=
errors
.
WithStack
(
err
)
return
return
}
}
...
...
internal/logic/mobile_message.go
View file @
a6efa346
...
@@ -14,22 +14,24 @@ const APIDOMAIN string = "http://api.ichunt.com/msg/sendMessageByAuto"
...
@@ -14,22 +14,24 @@ const APIDOMAIN string = "http://api.ichunt.com/msg/sendMessageByAuto"
func
SendMessage
(
mobile
int64
,
content
string
){
func
SendMessage
(
mobile
int64
,
content
string
){
timeNow
:=
time
.
Now
()
.
Unix
()
if
mobile
!=
0
{
requestContent
,
_
:=
json
.
Marshal
(
map
[
string
]
string
{
"content"
:
content
})
timeNow
:=
time
.
Now
()
.
Unix
()
requestTel
,
_
:=
json
.
Marshal
([]
int64
{
mobile
})
requestContent
,
_
:=
json
.
Marshal
(
map
[
string
]
string
{
"content"
:
content
})
requestTel
,
_
:=
json
.
Marshal
([]
int64
{
mobile
})
resp
,
err
:=
http
.
PostForm
(
APIDOMAIN
,
url
.
Values
{
"data"
:
{
string
(
requestContent
)},
resp
,
err
:=
http
.
PostForm
(
APIDOMAIN
,
url
.
Values
{
"touser"
:
{
string
(
requestTel
)},
"data"
:
{
string
(
requestContent
)},
"keyword"
:
{
"user_credit_apply_check"
},
"touser"
:
{
string
(
requestTel
)},
"k1"
:
{
Int64TurnString
(
int64
(
timeNow
))},
"keyword"
:
{
"user_credit_apply_check"
},
"k2"
:
{
Md5
(
Md5
(
Int64TurnString
(
int64
(
timeNow
)))
+
APIMD5STR
)},
"k1"
:
{
Int64TurnString
(
int64
(
timeNow
))},
"is_ignore"
:
{},
"k2"
:
{
Md5
(
Md5
(
Int64TurnString
(
int64
(
timeNow
)))
+
APIMD5STR
)},
})
"is_ignore"
:
{},
})
if
err
!=
nil
{
fmt
.
Print
(
err
)
if
err
!=
nil
{
fmt
.
Print
(
err
)
}
defer
resp
.
Body
.
Close
()
}
}
defer
resp
.
Body
.
Close
()
}
}
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