Commit fbe19fe5 authored by haoyanbin's avatar haoyanbin

1

parent 04352d23
......@@ -92,8 +92,8 @@ func CreateSurveyLog(c *gin.Context) {
var req model.SurveyLog
_ = c.ShouldBindJSON(&req)
ipData, _ := service.GetIpaddr(c.ClientIP())
//ipData, _ := service.GetIpaddr("125.34.219.138")
//ipData, _ := service.GetIpaddr(c.ClientIP())
ipData, _ := service.GetIpaddr("125.34.219.138")
//fmt.Println(ipData)
req.Country = ipData.Country
......
......@@ -116,7 +116,7 @@ encrypt:
key: "75SIQyfvwHDU0GbO"
common:
type: "2"
url: "dt.pet-dbc.cn"
url: "dt.bk-pet.cn"
sms:
smsname: "dbc"
......
......@@ -116,7 +116,7 @@ encrypt:
key: "75SIQyfvwHDU0GbO"
common:
type: "2"
url: "dt.pet-dbc.cn"
url: "dt.bk-pet.cn"
sms:
smsname: "dbc"
......
......@@ -18,18 +18,18 @@ func GetIpaddr(ip string) (utils.IpData, string) {
d, _ := time.ParseDuration("-6h")
beforetime := nowtime.Add(d)
beforetime := nowtime.Add(d).Format("2006-01-02 15:04:05")
data := new(model.Ipaddr)
table := " ipaddr "
field := " id, mobile, code, status "
field := " id, ip, code, data "
sqlStr := "SELECT " + field +
" FROM " + table +
" WHERE ip = ? and code = 200 and create_time > " +
" WHERE ip = '" + ip + "' and code = 200 and create_time > '" + beforetime + "'" +
" ORDER BY create_time desc "
err := global.GVA_DB.Raw(sqlStr, ip, beforetime).Find(&data)
err := global.GVA_DB.Raw(sqlStr).Find(&data)
if err != nil {
fmt.Println(err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment