Browse Source

feat: real sign

master
黄梓健 5 years ago
parent
commit
a207ab7036
  1. 10
      controllers/client/sign.go
  2. 2
      log/hdzj.log
  3. 6
      models/real_sign_list.go

10
controllers/client/sign.go

@ -201,11 +201,13 @@ func (t *SignCtl) RealSign() {
continue continue
} }
name, _ := m["name"].(string) name, _ := m["name"].(string)
val, _ := m["val"].(string)
if value, ok := t.Get(name); ok { if value, ok := t.Get(name); ok {
params[name] = value
extSql += "and json_list like \"%" + value + "%\" "
params[val] = value
//extSql += " json_list like '%\"" + val + "\"" + ":" + "\"" + value + "\"%' and "
extSql += " json_list like '%" + value + "%' and "
} else { } else {
t.ERROR(fmt.Sprintf("%v不能为空", m["val"]), code.MSG_ERR_Param)
t.ERROR(fmt.Sprintf("%s不能为空", val), code.MSG_ERR_Param)
} }
} }
if len(extSql) == 0 || len(params) == 0 { if len(extSql) == 0 || len(params) == 0 {
@ -215,10 +217,10 @@ func (t *SignCtl) RealSign() {
exist, err = new(models.RealSignList).CheckSignIn(activityId, extSql) exist, err = new(models.RealSignList).CheckSignIn(activityId, extSql)
t.CheckErr(err) t.CheckErr(err)
var body []byte var body []byte
body, err = json.Marshal(params) body, err = json.Marshal(params)
t.CheckErr(err) t.CheckErr(err)
history.SignRuleId = sign.Id history.SignRuleId = sign.Id
history.SignMethod = 2 history.SignMethod = 2
history.ActivityId = activityId history.ActivityId = activityId

2
log/hdzj.log

@ -472,3 +472,5 @@
2020-06-04 19:56:25.166 ERROR utils/utils.go:155 定时任务错误原因欧轩互动打赏过期退款错误: <xml><result_code>FAIL</result_code><err_code>ORDERNOTEXIST</err_code><err_code_des>订单不存在</err_code_des></xml>, out_trade_no: FWH6rL0SZcDY5ensh9ge5iFXGlA7bsOw 2020-06-04 19:56:25.166 ERROR utils/utils.go:155 定时任务错误原因欧轩互动打赏过期退款错误: <xml><result_code>FAIL</result_code><err_code>ORDERNOTEXIST</err_code><err_code_des>订单不存在</err_code_des></xml>, out_trade_no: FWH6rL0SZcDY5ensh9ge5iFXGlA7bsOw
2020-06-04 20:26:26.117 ERROR utils/utils.go:155 定时任务错误原因欧轩互动打赏过期退款错误: <xml><result_code>FAIL</result_code><err_code>ORDERNOTEXIST</err_code><err_code_des>订单不存在</err_code_des></xml>, out_trade_no: FWH6rL0SZcDY5ensh9ge5iFXGlA7bsOw 2020-06-04 20:26:26.117 ERROR utils/utils.go:155 定时任务错误原因欧轩互动打赏过期退款错误: <xml><result_code>FAIL</result_code><err_code>ORDERNOTEXIST</err_code><err_code_des>订单不存在</err_code_des></xml>, out_trade_no: FWH6rL0SZcDY5ensh9ge5iFXGlA7bsOw
2020-06-05 09:27:30.973 ERROR utils/utils.go:155 定时任务错误原因获取过期打赏错误原因: dial tcp: lookup gz-cdb-onvbcfqn.sql.tencentcdb.com: no such host 2020-06-05 09:27:30.973 ERROR utils/utils.go:155 定时任务错误原因获取过期打赏错误原因: dial tcp: lookup gz-cdb-onvbcfqn.sql.tencentcdb.com: no such host
2020-06-05 11:08:49.589 ERROR controllers/base.go:209 check err{error 25 0 Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?) LIMIT 1' at line 1}
2020-06-05 11:11:26.187 ERROR controllers/base.go:209 check err{error 25 0 Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%"姓名":"张三"% and json_list like %"电话":"17688484884"% and json_list ' at line 1}

6
models/real_sign_list.go

@ -1,7 +1,6 @@
package models package models
import ( import (
"fmt"
"github.com/ouxuanserver/osmanthuswine/src/core" "github.com/ouxuanserver/osmanthuswine/src/core"
"time" "time"
) )
@ -24,6 +23,7 @@ func (t *RealSignList) TableName() string {
// 可能使用模糊匹配 // 可能使用模糊匹配
func (t *RealSignList) CheckSignIn(aid int64, ext string) (bool, error) { func (t *RealSignList) CheckSignIn(aid int64, ext string) (bool, error) {
var sql = fmt.Sprintf("is_delete=0 and activity_id=%d %s", aid, ext)
return core.GetXormAuto().Where(sql).Get(t)
//var sql = fmt.Sprintf("is_delete=0 and activity_id=%d and ", aid, ext)
ext += " 1 = 1 "
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Where(ext).Get(t)
} }
Loading…
Cancel
Save