From d5387a7b9fde1d5ecfe1f0807574a308d9486b50 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 2 Nov 2023 14:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sms/api.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sms/api.go b/sms/api.go index cbb21d5..d29f02e 100644 --- a/sms/api.go +++ b/sms/api.go @@ -70,7 +70,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error { where = map[string]interface{}{ "appkey": args["smsmsg_key"], "zone": args["zone"], - "phone": args["phone"], + "phone": args["mobile"], "templateCode": args["templateCode"], } send, err = SmsMobApiSend(where) @@ -122,9 +122,12 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error { SmsType: args["sms_type"].(string), } engine.InsertOne(&record) - sql := `UPDATE sms_num_list set num=num-%d WHERE uid=%s and type=%s;` + sql := `UPDATE sms_num_list set num=num-%d WHERE uid=%s and type='%s';` sql = fmt.Sprintf(sql, count*int(contentLen), args["uid"], args["sms_type"]) - db.QueryNativeString(engine, sql) + fmt.Println(sql) + nativeString, err := db.QueryNativeString(engine, sql) + fmt.Println(nativeString) + fmt.Println(err) return nil } @@ -154,7 +157,7 @@ func SmsApiSend(engine *xorm.Engine, method string, args map[string]interface{}) } func SmsMobApiSend(args map[string]interface{}) (string, error) { thisUrl := "https://webapi.sms.mob.com/sms/sendmsg" - post, err := zhios_third_party_utils.CurlPost(thisUrl, zhios_third_party_utils.SerializeStr(args), nil) + post, err := zhios_third_party_utils.CurlPost(thisUrl, args, nil) fmt.Println(string(post)) fmt.Println(err) return string(post), err