소스 검색

积分功能调整

zhangjinkun@topnet.net.cn 9 년 전
부모
커밋
c9ae3f6e28
4개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 0
      common/src/qfw/util/common.go
  2. 2 1
      common/src/qfw/util/credit/credit.go
  3. 1 1
      core/src/qfw/member/credit/creditdetail.go
  4. 1 1
      credit/src/qfw/creditrpc/creditrpc.go

+ 7 - 0
common/src/qfw/util/common.go

@@ -356,3 +356,10 @@ func InterfaceArrTointArr(arr []interface{}) []int {
 	}
 	return tmp
 }
+func InterfaceArrToint64Arr(arr []interface{}) []int64 {
+	tmp := make([]int64, 0)
+	for _, v := range arr {
+		tmp = append(tmp, int64(v.(float64)))
+	}
+	return tmp
+}

+ 2 - 1
common/src/qfw/util/credit/credit.go

@@ -107,7 +107,8 @@ func InCreditB(userId, code string, param map[string]interface{}) (bool, int, er
 	err := Rc.InCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: 0, OtherParam: param}, &Replay)
 	if err == nil && Replay != 0 {
 		b = true
-	} else {
+	}
+	if err != nil {
 		log.Println("调用rpc出错", err)
 	}
 	return b, Replay, err

+ 1 - 1
core/src/qfw/member/credit/creditdetail.go

@@ -105,7 +105,7 @@ func (c *credit) InCreditAjx() error {
 			}
 		}
 		if param == "qd" {
-			b := cd.UpuserCreditSession(userId, cd.B_QD, "A", nil, c.Action)
+			b := cd.UpuserCreditSession(userId, cd.B_QD, "B", nil, c.Action)
 			if b {
 				c.Session().UpdateByCustomField("id", userId, "credit_qd", "y")
 				result["result"] = "y"

+ 1 - 1
credit/src/qfw/creditrpc/creditrpc.go

@@ -104,7 +104,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
 					obj := redis.Get(consts.RedisDB, key)
 					bcon := true
 					if obj != nil {
-						newobj := obj.([]int64)
+						newobj := util.InterfaceArrToint64Arr(obj.([]interface{}))
 						//比较日期是不是连续签到,并且在有效次数内
 						if newobj[1] < newobj[2] && time.Unix(newobj[0], 0).AddDate(0, 0, 1).Day() == now.Day() {
 							newobj[0] = now.Unix()