|
@@ -67,7 +67,7 @@ func init() {
|
|
|
}
|
|
|
|
|
|
//一次性任务积分
|
|
|
-func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
|
|
|
+func InCreditA(userId, code string, credit_a int64) (bool, int64, int, error) {
|
|
|
result := false
|
|
|
if len(userId) < 1 {
|
|
|
return result, credit_a, 0, nil
|
|
@@ -87,7 +87,7 @@ func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
|
|
|
}
|
|
|
|
|
|
//剑鱼一次性任务
|
|
|
-func CheckSword(userId, code string, credit_a int, xb *xweb.Action) bool {
|
|
|
+func CheckSword(userId, code string, credit_a int64, xb *xweb.Action) bool {
|
|
|
result := false
|
|
|
if !AIsHasDo(code, credit_a) {
|
|
|
result, credit_a = UpuserCreditA(code, userId, credit_a)
|
|
@@ -116,18 +116,18 @@ func InCreditB(userId, code string, param map[string]interface{}) (bool, int, er
|
|
|
}
|
|
|
|
|
|
//更新用户一次性积分状态
|
|
|
-func UpuserCreditA(code, userId string, credit_a int) (bool, int) {
|
|
|
+func UpuserCreditA(code, userId string, credit_a int64) (bool, int64) {
|
|
|
var ret uint64
|
|
|
if tmp, ok := CreditA[code]; ok {
|
|
|
ret = 1 << (tmp - 1)
|
|
|
}
|
|
|
n_credit_a := uint64(credit_a) + ret
|
|
|
b := mogo.Update("user", `{"_id":"`+userId+`"}`, &map[string]interface{}{"$set": &map[string]interface{}{"credit_a": int64(n_credit_a)}}, true, false)
|
|
|
- return b, int(n_credit_a)
|
|
|
+ return b, int64(n_credit_a)
|
|
|
}
|
|
|
|
|
|
//判断一次性积分是否完成
|
|
|
-func AIsHasDo(code string, num int) bool {
|
|
|
+func AIsHasDo(code string, num int64) bool {
|
|
|
b := false
|
|
|
var ret uint64
|
|
|
if tmp, ok := CreditA[code]; ok {
|
|
@@ -140,7 +140,7 @@ func AIsHasDo(code string, num int) bool {
|
|
|
}
|
|
|
|
|
|
//判断A是否完成
|
|
|
-func AAllIsHasDo(num int) bool {
|
|
|
+func AAllIsHasDo(num int64) bool {
|
|
|
b := false
|
|
|
var ret uint64
|
|
|
for k, v := range CreditA {
|
|
@@ -187,7 +187,7 @@ func UpuserCreditSession(userId, code, dtype string, param map[string]interface{
|
|
|
score := 0
|
|
|
util.Try(func() {
|
|
|
if dtype == "A" {
|
|
|
- credit_a := util.IntAll(xb.GetSession("credit_a"))
|
|
|
+ credit_a := util.Int64All(xb.GetSession("credit_a"))
|
|
|
b, credit_a, score, _ = InCreditA(userId, code, credit_a)
|
|
|
if b {
|
|
|
xb.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
|